General information
Category:
Coding, syntax & commands
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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only