Microsoft KB Archive/263685

= BUG: Access Violation in VB IDE When Compiling ADODB.Connection.Execute Method =

Article ID: 263685

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



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 &quot;0x0fbdf239&quot; referenced memory at &quot;0x11c92028&quot;. The memory could not be &quot;read&quot;.



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.



Steps to Reproduce Behavior
 Start a new Standard EXE project in Visual Basic. Form1 is created by default. From the Project menu, click References, click to select Microsoft ActiveX Data Objects 2.5 Library, and then click OK.  Put the following code in the code window of Form1: Dim cn As Connection Private Sub Foot(v As Variant) cn.Execute &quot;&quot;, v(0) End Sub  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 &quot;Symptoms&quot; section appears.  To work around the problem, replace the code inside Foot with the following: Dim x as Variant cn.Execute &quot;&quot;, x   v(0) = x                    </ol>

Keywords: kbbug kbdatabase kbpending kbideproject KB263685

-

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

© Microsoft Corporation. All rights reserved.