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