Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewID() Stored Procedure is firing twice...
Message
From
16/07/1999 12:30:55
 
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00241777
Message ID:
00242370
Views:
16
>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

It sounds like you have the default value for the PK set in both the vew and the table. This is fine, but if you do this, you have to make sure that PK field is set as updateable in the view (by default, when you click update all in the view designer, it leaves out the PK).

It sounds like what is happening to you is that the PK is getting filled in the view, but the update property for the PK is not set, so when you do a TABLEUPDATE() the values is not written to the base table, and so the base table finds its own PK by firing the NEWID method again.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform