BUG: Crash Updating Linked Table with ADO2.1/Jet 4 OLEDB Provider
ID: Q235433
|
The information in this article applies to:
-
ActiveX Data Objects (ADO), versions 2.1, 2.1 SP1, 2.1 SP2
-
Microsoft OLE DB Provider for Jet, version 4.0
SYMPTOMS
When updating a linked SQL Server table using the Jet 4 OLEDB provider, a crash might occur with the following error message:
The instruction at '0x1b01a333' referenced memory at '0x0000000c'. The memory could not be 'read'.
Click on OK to terminate the application
Click on CANCEL to debug the application
The crash occurs when sending 220 (or more) total characters in the update statement (either in one or multiple fields.)
RESOLUTION
Avoid performing the updates via the linked table. Send your updates straight to your SQL Server table.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
MORE INFORMATION
The sample code below assumes the following scenario:
VB application (Client machine)
|
|--(Jet 4 OLEDB Provider)--> Linked Table in Access (Remote machine)
|
|--(ODBC DSN)--> SQL Server Table (Remote machine)
Steps to Reproduce Behavior
- Create the following SQL Server table (server machine):
CREATE TABLE dbo.pepers (ID int NOT NULL Primary Key,
TestField char (220))
GO
- Insert ID # 1920 into the table.
- Create a DSN going to the pepers table on the server machine.
- Create a new linked table in an Access database that goes to pepers table. "dbo_pepers" would be created by default.
- Create a new Visual Basic 6.0 Standard EXE project (on client machine) using the following code:
Option Explicit
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim sqlStr as String
Private Sub Command1_Click()
cn.CursorLocation = adUseClient
With cn
.ConnectionString = "Data Source= <path>\<Access database>"
.Provider = "Microsoft.JET.OLEDB.4.0"
.Properties("Prompt") = adPromptComplete
.Open
End With
' The following statement would update 220 characters on the char (220) TestField
sqlStr = "UPDATE dbo_pepers SET TestField='" & _
"send10char send10char send10char send10char " & _
"send10char send10char send10char send10char " & _
"send10char send10char send10char send10char " & _
"send10char send10char send10char send10char " & _
"send10char send10char send10char send10char'" & _
"WHERE ID = 1920"
cn.Execute sqlStr ' <--- crash occurs here
cn.Close
- Add a Reference to "Microsoft ActiveX Data Objects 2.1 Library," and also place a Command Button on the form.
- Click on Command1 button two or three times and the crash would occur.
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Ammar Abuthuraya, Microsoft Corporation
Additional query words:
Keywords : kberrmsg kbADO kbOLEDB210bug
Version : WINDOWS:2.1,2.1 SP1,2.1 SP2,4.0
Platform : WINDOWS
Issue type : kbbug