Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO and SQL stored procedures
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00560234
Message ID:
00560295
Vues:
19
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform