BUG: Crash Updating Linked Table with ADO2.1/Jet 4 OLEDB ProviderID: Q235433
|
When updating a linked SQL Server table using the Jet 4 OLEDB provider, a crash might occur with the following error message:
The crash occurs when sending 220 (or more) total characters in the update statement (either in one or multiple fields.)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
Avoid performing the updates via the linked table. Send your updates straight to your SQL Server table.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
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 TABLE dbo.pepers (ID int NOT NULL Primary Key,
TestField char (220))
GO
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
© 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
Last Reviewed: June 24, 1999