FIX: ADO DataControl and DataEnvironment Events Only Work with ADO 2.0 (257714)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.01
- 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
- ActiveX Data Objects (ADO) 2.5 SP2
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q257714 SYMPTOMS
When you attempt to use the events of an ADO Data Control or the DataEnvironment with a reference to a version of the Microsoft ActiveX Data Objects (ADO) later than version 2.0, you receive the following error message:
Compile error:
Procedure declaration does not match description of event or procedure having the same name.
CAUSE
The ADO Data Control and the Data Environment were compiled using Microsoft Data Access Components version 2.0.
RESOLUTION
This problem no longer occurs with the ADO Data Control and the Data Environment that ship with Microsoft Visual Studio Service Pack 4 and later.
However, you must now use a reference to the Microsoft ActiveX Data Objects 2.5 Library or later if you are using ADO Data Control and Data Environment events. The ADO Data Control and the Data Environment have been recompiled using Microsoft Data Access Components 2.5. That is, you now see the preceding error message when using the ADO Data Control or the Data Environment with a reference to a version of Microsoft Data Access Components prior 2.5.
In short, when using the events of the ADO Data Control or the Data Environment in Microsoft Visual Basic 6.0 Service Pack 4, be sure to do the following:
- From the Project menu, clink to select References.
- From the list of available References, deselect references to Microsoft ActiveX Data Objects prior to version 2.5.
- From the list of available References, select Microsoft ActiveX Data Objects 2.5 or later.
For versions of Visual Studio prior to service pack 4, the workaround is to add "20" to the ADODB.Recordset Parameter declaration, as described in the articles listed in the "References" section of this article.
IMPORTANT: The workaround as described in Q222145 does not work with Visual Studio 6.0 Service Pack 4. The code needs to be changed to use the original declarations for each of the events (20 needs to be removed from the Recordset Parameter declaration).
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0. For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base: 194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed To download the latest Visual Studio service pack, visit the following Microsoft Web site: REFERENCES222145 PRB:ADO Data Control Events May Generate a Compilation Error
193326 BUG:Data Form Wizard via Application Wizard Omits ADO Reference
Modification Type: | Minor | Last Reviewed: | 12/12/2005 |
---|
Keywords: | kbBug kbCtrl kbDatabase kbDataBinding kbDataEnv kbDesigner kbfix kbVS600sp4fix kbVS600sp5fix KB257714 |
---|
|