Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto Increment PK : VFP with SQL server as backend
Message
From
16/02/2012 19:09:01
Kam Lee
SUNY-Health Science Center
Brooklyn, New York, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Auto Increment PK : VFP with SQL server as backend
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01535625
Message ID:
01535625
Views:
108
Hi,
I have problem with the auto increment field when switching from Access to SQL server as backend.
I am not getting the new id from the sql server whereas I have no problem when I get the new id from Access

** code to get the new id (key) from the SQL server
oRecordset.AddNew
?oRecordset.Fields("id").Value && empty string; this used to be working when accessing Access

*This does not work neither:
oRecordset.AddNew
oRecordset.Update
?oRecordset.Fields("id").Value && returns empty string

What should I do to get the id field in the vfp program?

Thanks,
Kam.
Reply
Map
View

Click here to load this message in the networking platform