Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a keyfield from my sqldatabase via vfp
Message
From
03/11/2004 06:50:54
 
 
To
28/10/2004 08:18:30
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
00955223
Message ID:
00957503
Views:
16
This message has been marked as the solution to the initial question of the thread.
Hello,

yes your're right in your assumption ..
you can only query the value with "SELECT theKeyField FROM yourTable" after the transaction has been submitted ..

but you can use this one instead:

TABLEUPDATE('yourView')

LOCAL lnConnection
lnConnection = CURSORGETPROP("ConnHandle","yourView")

SQLEXEC(lnConnection,'SELECT @@Identity AS NewKey','KeyCursor')
yourNewKey = KeyCursor.NewKey


error handling disregarded in this example ..

Regards

Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform