How To Return Record's Autonumber Value Inserted into Access DB (221931)
The information in this article applies to:
- ActiveX Data Objects (ADO) 1.5
- ActiveX Data Objects (ADO) 2.0
- Microsoft Internet Information Server 3.0
- Microsoft Internet Information Server 4.0
- Microsoft Internet Information Server 5.0
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q221931 SUMMARY
When a new record is added to an ActiveX Data Objects (ADO) Recordset that contains an Autonumber field, immediately reporting the value of the Autonumber field for the inserted record returns a value of 0.
This article describes how to retrieve the automatically generated value of an Autonumber field of a record inserted into an Access database with the ADO AddNew() and Update() methods. The sample uses VBScript in an Active Server Pages (ASP) page.
REFERENCES
For additional information about using AutoIncrement fields and ADO, please see the following article in the Microsoft Knowledge Base:
195910 INFO: Identity (AutoIncrement) Columns in ADO or RDS
Modification Type: | Minor | Last Reviewed: | 7/13/2004 |
---|
Keywords: | kbDatabase kbhowto kbInetDev KB221931 |
---|
|