Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing for existing relationship?
Message
 
À
01/07/1999 17:24:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00236537
Message ID:
00236794
Vues:
9
Thanks, Ed. Your hint got me started. Here's what I came up with:

----------------------------------------------------
FUNCTION RELCHECK(lcTableName)
* Check to see if relationship already exists
* Enter with name of child table to check
* Parent table must be selected
* Returns .T. if relation to table already exists

LOCAL llRelStat

lnRelCount = 1
DO WHILE NOT EMPTY(RELATION(lnRelCount))
IF UPPER(lcTableName) = TARGET(lnRelCount)
llRelStat = .t.
RETURN llRelStat
ENDIF
lnRelCount = lnRelCount + 1
ENDDO
RETURN llRelStat

----------------------------------------------------

The only problem is that the most frequently used table is usually the first one opened, and it is the last one checked. It would be nice if there were some way to check the list backwards....

Neil

>>Is there a way in VFP6 to test for a relation that may or may not already exist?
>
>You may use RELATION(). It will return empty string if no relations exist for active table.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform