PRB: Error When You Update or Delete New Rows in Access 97 Table (294842)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q294842 SYMPTOMS
When you use ADO to edit and then update or delete newly added records in a Microsoft Access 97 table, you may receive the following error message when you call the Update method:
Run-time error '-2147217864 (80040e38)':
Row cannot be located for updating. Some values may have been changed since it was last read.
This error message may also occur when you edit or delete newly added records in a DataGrid control. The DataGrid control issues an Update behind the scenes when you move to another row. NOTE: This error does not occur when you edit or delete existing records.
CAUSE
The Access 97 table contains an AutoNumber field, and the auto-incremented values of newly added records may not be available for the client recordset. For example, if the AutoNumber field is 5 for the new record in the table, the value of this field in the recordset is always 0. ADO uses this value to locate the record when ADO builds an Update Action Query and sends the value to the Microsoft Jet engine to perform the Update on the specified record. However, the Jet engine cannot locate the record based on that value; thus, you receive the above-mentioned error message.
RESOLUTION
The OLE DB Provider for Jet versions 3.51 and 4.0, as well as the Access ODBC drivers 3.51 and 4.0, cannot retrieve the AutoNumber value of newly inserted records from an Access 97 table. This functionality is available only in Microsoft Access 2000 tables. To resolve this problem, upgrade to Access 2000. For more information, see the following Microsoft Web site:
If you cannot upgrade to Access 2000, avoid using AutoNumber fields.
REFERENCESFor additional information about using AutoNumber fields and ADO, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
244136 INFO: When is the Access AutoNumber Field Available?
233299 INFO: Identity and Auto-Increment Fields in ADO 2.1 and Beyond
232144 INFO: Jet OLE DB Provider Version 4.0 Supports SELECT @@Identity
Modification Type: | Major | Last Reviewed: | 10/17/2001 |
---|
Keywords: | kbDatabase kbDSupport kbJET kbprb KB294842 kbAudDeveloper |
---|
|