Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO and SQL stored procedures
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00560234
Message ID:
00560295
Views:
18
Kurt,

Thanks so much for the info. I will talk to my DBA's to see if they will add a new stored procedure for this process. I work for a large shop where a lot of code has already been written around the current stored procedure for getting the next key.

BTW, if I use identity fields and need to get the identity value back after an insert, how would I accomplish this using ADO?

Thanks again,

James


>James,
>Try declaring an additional parameter as an OUTPUT parameter, ie:
>
>CREATE PROC sp_getkey @tablename varchar(50), @returnkey integer OUTPUT AS.....
>
>Set the @returnkey parameter in your stored procedure and check it AFTER calling the execute method to see what value was returned.
>
>.Execute()
>lnReturnKey = .Parameters('@returnkey').Value
>
>Typically, creating a recordset that only contains one value is a lot of overhead and should be avoided if you can return a parameter instead.
>
>Hope this helps.
>Kurt
James Moore
Owner/Developer
Ministry Tracking Software, Inc.
www.youthtrack.com
Previous
Reply
Map
View

Click here to load this message in the networking platform