Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Relation problem
Message
From
25/08/1997 17:58:36
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
 
 
To
25/08/1997 16:43:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00046742
Message ID:
00046809
Views:
27
>>>I was not getting a table to follow in a relation when I tried to relate them visually in the DE, so I tried to do it manually in the LOAD event. Here is the code:
>>>
>>>oDataHandler.UseAgain("Schedule", "tSchedule")
>>>SET ORDER TO audit_num
>>>oDataHandler.UseAgain("pending", "tPending")
>>>SET ORDER TO actnum
>>>oDataHandler.UseAgain("assigned", "tAssigned")
>>>SET ORDER TO toll
>>>oDataHandler.UseAgain("account", "tAccount")
>>>SET ORDER TO actnum
>>>oDataHandler.UseAgain("Tracking", "tTracking")
>>>SET ORDER TO audit_num
>>>oDataHandler.UseAgain("Password", "tPassword")
>>>SET ORDER TO emp_id
>>>
>>>** pending relations
>>>SET RELATION TO audit_num INTO tSchedule IN tPending ADDITIVE
>>>SET RELATION TO audit_num INTO tTracking IN tPending ADDITIVE
>>>
>>>SELECT tpending
>>>SET ORDER TO actnum
>>>
>>>SET RELATION TO TOLL INTO tAssigned IN tPending ADDITIVE
>>>
>>>**assign relations
>>>SET RELATION TO actnum INTO tAccount IN tAssigned ADDITIVE
>>>
>>>**tracking relation
>>>SET RELATION TO emp_id INTO tPassword IN tTracking ADDITIVE
>>
>>The indexes are as follows:
>>>
>>>Table Index
>>>
>>>PENDING AUDIT_NUM
>> ACTNUM
>>
>>SCHEDULE AUDIT_NUM
>>
>>ASSIGNED TOLL
>> ACTNUM
>>
>>ACCOUNT ACTNUM
>>
>>TRACKING AUDIT_NUM
>> EMP_ID
>>
>>PASSWORD EMP_ID
>>>
>>
>>Graphically the relations look correct when viewed with the data session. However, the "tScheduled" table does follow the tPending table as it should. Also I get the error "Cannot locate variable "toll" when the program reached the line "SET RELATION TO TOLL INTO tAssigned IN tPending ADDITIVE"
>>
>>Does someone know what could be going on with this?
>>
>>Ed
>>>
>The syntax for set relation to allows you to SET A RELATION for a table without selecting it into the current work area with the IN clause. when you SET RELATION TO TOLL, VFP looks for a field called toll in the current work area to set the relation to unless you have issued the statement with the IN clause, in which case it looks for toll in the specified table. From the looks of your useagain code, toll is a field in tAssigned, not in tPending. I am not clear on the Parent /Child layout of your data structure, but it looks as if you are trying to create the relationship backwards.


Erik:

That was it, I got them backwards. Thanks.

Ed
Previous
Reply
Map
View

Click here to load this message in the networking platform