Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting primary key after an insert
Message
From
08/06/2006 11:15:23
 
 
To
08/06/2006 11:08:30
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01127217
Message ID:
01127854
Views:
30
>I believe VFPOLEDB is multiuser and multithread safe.
>
>If you pass 0 to GETAUTOINCVALUE, it is similar to scope_identity(). Help is pretty clear on this: "0 Specifies that the last autoincremented field value returned is derived from the current scope (function, method, procedure)." Connection is a scope. Therefore, additional synchronization should be used if you execute INSERTs and GETAUTOINCVALUE(0) on different threads at the same time through the same connection (no difference with scope_identity() here).

So, basically, both approaches would be safe in this case. So, that would mean that as long as the connection to the adapter is valid, using this function would return the incremental key value of the last insert. In such situation, do you recomment the first approach or the event handler approach?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform