This article was previously published under Q281887
If you use a DataGrid to add a record to a server-side ActiveX Data Objects (ADO) recordset, you receive one of the following error messages when there are more records than the DataGrid can display:
c0000005 (access violation)
The Invalid Bookmark error message appears if Visual Studio Service Pack 5 (SP5) has not been applied. The access violation error message appears if you have Microsoft Data Access Components (MDAC) 2.6 or MDAC 2.7 installed (without any service pack) on a computer that has Visual Studio Service Pack 5 (SP5) installed.
To resolve this problem, obtain the latest service pack for Microsoft Data Access Components (MDAC ) 2.6 or MDAC 2.7. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
300635 INFO: How to Obtain the Latest MDAC 2.6 Service Pack
The easiest resolution is to switch to client-side cursors for instances where DataGrids are used to add records to ADO recordsets.
This problem was first corrected in MDAC 2.6 Service Pack 1, and MDAC 2.7 Service Pack 1.
Visual Studio 6.0
This bug was corrected in Microsoft Visual Studio 6.0 Service Pack 5 (SP5). For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:
194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed
To download the latest Visual Studio service pack, visit the following Microsoft Web site:
Create a new Standard EXE in Visual Basic. Form1 is created by default.
On the Project menu, choose Components, choose Microsoft ADO Data Control 6.0 and Microsoft DataGrid Control 6.0, and then place an instance of each on the form.
Right-click the ADO Data Control and, on General tab, set up a connection string to a SQL Server database.
Select the Recordsource tab, select 2-adCmdTable, and then select a table in the database from the drop-down list.
On the ADODC1 property sheet, set the CursorLocation property to 2-adUseServer.
On the property sheet, select the DataGrid, and then set AllowAddNew to True and DataSource to ADODC1.
Run the project and press the PAGE DOWN key until you get to the bottom of the DataGrid.
When you get to the last row, click in a field and begin to add a record. When you move off of the newly added field in the new record, you receive one of the two error messages listed in the "Symptoms" section unless Visual Studio SP5 has been applied on a computer that is running MDAC 2.5.
To revert back to an earlier version of MDAC, use the Component Checker Tool that you can download from the following Microsoft Web site: