Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to retrieve SQL Identity Column values?
Message
From
03/10/2001 08:46:10
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00562994
Message ID:
00563522
Views:
27
Vlad:
Just to follow up for others who might not be aware. I had tried this approach some time ago, but could never get the SQLEXEC to return a result set. I found in BOL where in asynch mode, you have to repeatedly call SQLEXEC until it returns a result set. So I modified your code just a bit as follows:

Local lnRetVal

lnRetVal = SQLEXEC(nHandle, "SELECT @@IDENTITY as nID","MyCursor")
Do While lnRetVal=0
lnRetVal = SQLEXEC(nHandle, "SELECT @@IDENTITY as nID","MyCursor")
EndDo

This seems to always catch it on just the second pass.

Thanks again...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform