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:51:52
 
 
To
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:
00563527
Views:
17
Well, if you use asynch mode, this can cause a lot of problems, such as "Connection Busy" errors when you share connection between views. Anyway, your correction is correct, in help there is the same note ;)

>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...
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform