Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLEDB: how to get last auto-increment value after INSERT
Message
From
01/10/2015 16:59:37
Joe Kaufman
Bell Laboratories Inc.
Wisconsin, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Network:
Novell 6.x
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01625339
Message ID:
01625341
Views:
43
Borislav,

You ROCK!

I have been back in VFP 8.0 for so long I forgot about GETAUTOINCVALUE().

I confirmed it works, and I even confirmed that just a straight call to the function without housing it in a SELECT statement works fine. I am going to set it up in an ExecuteScalar routine so that I can always get the last auto-inc field generated with one call. Will probably make that function return true if there is a number to be had, and false otherwise (because it could be NULL if no auto-inc was generated...)

You saved me on this one, I can't thank you enough!

Thanks,
JoeK
Previous
Reply
Map
View

Click here to load this message in the networking platform