Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing for existing relationship?
Message
 
To
01/07/1999 17:24:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00236537
Message ID:
00236794
Views:
8
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
Map
View

Click here to load this message in the networking platform