BUG: Access Violation in VB IDE When Compiling ADODB.Connection.Execute Method (263685)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition for Windows 5.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 5.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

This article was previously published under Q263685

SYMPTOMS

When you are compiling a project by using the ADODB.Connection.Execute method in Visual Basic 5.0 or Visual Basic 6.0, the Integrated Development Environment (IDE) may shut down or get an Access Violation (AV) with the following error message:
The instruction at "0x0fbdf239" referenced memory at "0x11c92028". The memory could not be "read".

RESOLUTION

Pass a Variant variable instead of an Array element as the second argument for the Execute method.

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

  1. Start a new Standard EXE project in Visual Basic. Form1 is created by default.
  2. From the Project menu, click References, click to select Microsoft ActiveX Data Objects 2.5 Library, and then click OK.
  3. Put the following code in the code window of Form1:
    Dim cn As Connection
    Private Sub Foot(v As Variant)
        cn.Execute "", v(0)
    End Sub
    					
  4. Save and compile the project in Native code (which is the default.) To confirm that you are compiling to Native code, on the Project menu, click Project1 Properties, and then click on the Compile tab. Note that the Access Violation described in the "Symptoms" section appears.
  5. To work around the problem, replace the code inside Foot() with the following:
        Dim x as Variant
        cn.Execute "", x
        v(0) = x
    					

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbDatabase kbDSupport kbIDEProject KB263685