Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.Net and VFP AutoIncrement
Message
From
28/09/2005 10:04:26
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Title:
.Net and VFP AutoIncrement
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01053932
Message ID:
01053932
Views:
52
I'm writing a business object in .Net that is using a VFP database container with autoincrement primary keys. I want to send an INSERT statement using an OLEDB command and get back the value that was assigned to the auto increment field. I know about the GETAUTOINCVALUE() function that returns this value. The problem is getting the value back to my .Net class. I looked in the help file and this function is not listed in the "Supported VFP Commands" or the "Unsupported VFP Commands".

When I do this with a SQL Server database I can send something like this in a single command object:
INSERT INTO tablename (fieldlist) VALUES (valuelist)
IF @@ROWCOUNT < 1
  SELECT -1 AS [SCOPE_IDENTITY]
ELSE
  SELECT Convert(INT, SCOPE_IDENTITY()) AS [SCOPE_IDENTITY]
How can I do something similar with VFP?
Thanks,
Dan Jurden
djurden@outlook.com
Next
Reply
Map
View

Click here to load this message in the networking platform