Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewID() Stored Procedure is firing twice...
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00241777
Message ID:
00242266
Views:
19
>I'm using VFP tables in a VFP Database accessing through local views also in the VFP Database. When I add a new record to the table using cListObjEdit class it seems to be triggering the newid() stored procedure when adding a new record to the view and newid() triggers again when the tableupdate() command is issued.
>
>This is causing a problem when I'm a parent/child relationship and adding to both. I can't seem to get the correct unique id's to jive, hence no relation.
>
>I'd appreciate the help... thanks
>
>Vic

Vic,

Not sure if I have this right, but are you saying the newid() stored procedure is firing twice, once for the parent table and then a second time for the child table? If so, this is correct procedure to ensure unique id's in each table. In a parent/child relationship, you need to add another field to the child table, something like parentid. Then when you go to save changes, the parent table has a unique id, which you can store to a child(s) record in the parentid field. Each child record though will have it's own unique id to ensure the primary index of that table.

Kind Regards,

Mat
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Previous
Reply
Map
View

Click here to load this message in the networking platform