Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting primary key after an insert
Message
From
06/06/2006 01:04:29
 
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:
01127267
Views:
18
>Can you use this SQL "SELECT GETAUTOINCVALUE(0) FROM OneRecordCursor" ?

You cannot use a cursor in OleDB. Also, such a command would need to be executed at the same time the insert is done, which I don't think is possible under this environment. What I do for now is to select the last record added to the table from that user. For any new record in a table, I have a field AddUser which is maintained. So, I select the last one and this gives me the record ID. But, I don't like this approach. I really something at the insert level.
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