>Rajesh,
>
>You should use scope_identity() instead of @@identity.
>
>>How to return the autoinc field from sql server.
>>I think the @@identity should do the work but am confused with the insertrefreshcmd.
I am not sure SCOPE_IDENTITY() will works, becuase when you refresh CA you already are out of scope :o)
I saw in SQL Profiler that INSERT command and Refresh command are in two different Batches (tested with ODBC connection not with ADO). He must use IDENT_CURRENT('Table_name') if He use SQL Server 2005. But I think @@IDENTITY should work :o)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.