Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement