Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘microsoft data access components’

FIX: Invalid Bookmark Error Message Appears When Records Are Added to a Server-Side ADO Recordset

Symptoms
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:

Invalid Bookmark
-or-

c0000005 (access violation)
Resolution
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.

FIX: ADO DataControl and DataEnvironment Events Only Work with ADO 2.0

Symptoms
When you attempt to use the events of an ADO Data Control or the DataEnvironment with a reference to a version of the Microsoft ActiveX Data Objects (ADO) later than version 2.0, you receive the following error message:

Compile error:
Procedure declaration does not match description of event or procedure having the same name.
Resolution
The ADO Data Control and the Data Environment were compiled using Microsoft Data Access Components version 2.0.

FIX: “Invalid Procedure Call” Error with Preserve Keyword

Symptoms
The following error occurs if a variant set equal to an Array() function isredimensioned using the Preserve keyword:

Run-time error ‘5′ “Invalid Procedure Call or Argument”NOTE: This behavior occurs only under the following two conditions:If Microsoft Data Access Components (MDAC) 2.0 or Visual Studio 6.0is installed on the computer.
-and-If the array has not been initialized.
Resolution
This error occurs with the newer version of the OLE automation core file,(version 2.304261). The Oleaut32.dll file is installed in your systemdirectory when you install MDAC 2.0 or Visual Studio 6.0 products.

BUG: Error When You Use Client Cursor to Add Record to SQL Server Table That Has Default Value in Datetime Field

Symptoms
If you use ADO to insert a new record through a client-side recordset into a SQL Server table that has a non-nullable datetime field with a default value, you receive the following error message if you do not supply a value for the datetime field:

Run-time error ‘-2147217887 (80040e21)’: Multiple-step operation generated errors. Check each status value. This error occurs whether you use the OLE DB Provider for SQL Server or the OLE DB Provider for ODBC Drivers. The error message may differ when you use Microsoft Data Access Components (MDAC) version 2.5 Service Pack 1 (SP1) or earlier. This error does not occur with a server-side cursor.
Resolution
This error occurs in the Client Cursor Engine when it attempts to convert the value of type DBTYPE_DBTIMESTAMP to DBTYPE_VARIANT.