Microsoft KB Archive/235433

= BUG: Crash Updating Linked Table with ADO2.1/Jet 4 OLEDB Provider =

Article ID: 235433

Article Last Modified on 7/28/2003

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft OLE DB Provider for Jet 4.0

-



This article was previously published under Q235433



SYMPTOMS
When you use the OLE DB Provider for Jet version 4.0 to update a linked SQL Server table, a crash may 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.)

In MDAC version 2.5, you may generate a Dr. Watson error instead of the error listed earilier.



RESOLUTION
Avoid performing the updates via the linked table. Send your updates straight to your SQL Server table.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
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)   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= \<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

End Sub </li> Add a Reference to "Microsoft ActiveX Data Objects 2.x Library," and also place a Command Button on the form.</li> Click on Command1 button two to six times and the crash would occur.</li></ol>

Keywords: kberrmsg kbbug kbmdacnosweep kbpending KB235433

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.