| 
	
 | 
 Posted by Tom Moreau on 04/11/06 02:44 
Try: 
 
select 
    scope_identity() 
 
--  
   Tom 
 
---------------------------------------------------- 
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA 
SQL Server MVP 
Toronto, ON   Canada 
.. 
"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART IN  
CAPS> wrote in message news:1fB_f.527$7a.323@pd7tw1no... 
Hello, 
 
I am in the midst of converting an Access back end to SQL Server Express. 
The front end program (converted to Access 2003) uses DAO throughout.  In 
Access, when I use recordset.AddNew I can retrieve the autonum value for the 
new record.  This doesn't occur with SQL Server, which of course causes an 
error (or at least in this code it does since there's an unhandled NULL 
value).  Is there any way to retrieve this value when I add a new record 
from SQL server or will I have to do it programmatically in VB? 
 
Any direction would be great. 
 
Thanks!
 
[Back to original message] 
 |