Yes , I found out that you can retrieve the value of the IDENTITY variable by using the INSERT method and it gives you the most recently used IDENTITY value for the current connection. This must be the way to do it because the book that I'm getting this information from also states the following...
Does anyone know why I can retrieve the value of an AutoNumber field in Access before updating the recordset, but I can't do the same in SQL server.
Example:
************************
In Access this works:
rs.AddNew
iID = rs.Fields("ID") '*** AutoNumber field
rs.update...
Does anyone know why I can retrieve the value of an AutoNumber field in Access before updating the recordset, but I can't do the same in SQL server.
Example:
************************
In Access this works:
rs.AddNew
iID = rs.Fields("ID") '*** AutoNumber field
rs.update...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.