BUG: Crash Updating Linked Table with ADO2.1/Jet 4 OLEDB Provider (235433)



The information in this article applies to:

  • ActiveX Data Objects (ADO) 2.1
  • ActiveX Data Objects (ADO) 2.1 SP1
  • ActiveX Data Objects (ADO) 2.1 SP2
  • ActiveX Data Objects (ADO) 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.

MORE INFORMATION

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)
				
  1. Create the following SQL Server table (server machine):
    CREATE TABLE dbo.pepers (ID int NOT NULL Primary Key,
    	TestField char (220)) 
          GO
    					
  2. Insert ID # 1920 into the table.
  3. Create a DSN going to the pepers table on the server machine.
  4. Create a new linked table in an Access database that goes to pepers table. "dbo_pepers" would be created by default.
  5. 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
    
    End Sub
    					
  6. Add a Reference to "Microsoft ActiveX Data Objects 2.x Library," and also place a Command Button on the form.
  7. Click on Command1 button two to six times and the crash would occur.

Modification Type:MinorLast Reviewed:7/28/2003
Keywords:kbBug kberrmsg kbMDACNoSweep kbpending KB235433