Microsoft KB Archive/827049

= You receive a &quot;Compile error&quot; error message in your Visual Basic 6.0 Service Pack 5 project when you run data from code that is generated by the Data Form Wizard =

Article ID: 827049

Article Last Modified on 12/18/2003

-

APPLIES TO


 * Microsoft Visual Studio 6.0 Service Pack 5
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Professional Edition

-



SYMPTOMS
In a Microsoft Visual Basic Standard EXE project, you can use the Data Form Wizard to add a data form that connects to Microsoft Access 2000 or a later version. When you run the Visual Basic Standard EXE project, you may receive the following error message:

Compile error:

Procedure declaration does not match description of event or procedure having the same name



RESOLUTION
To resolve this problem, remove the reference to Microsoft ActiveX Data Objects 2.0 Library that the Data Form Wizard added and then add a reference to Microsoft ActiveX Data Objects 2.5 Library or a later version. To do this, follow these steps:
 * 1) On the Project menu, click References.
 * 2) In the References - Project1 dialog box, click to clear the Microsoft ActiveX Data Objects 2.0 Library check box.
 * 3) Click to select the Microsoft ActiveX Data Objects 2.5 Library check box, and then click OK.

Note In this step, you can use Microsoft ActiveX Data Objects 2.5 or a later version, such as Microsoft ActiveX Data Objects 2.6 or Microsoft ActiveX Data Objects 2.7.
 * 1) On the Run menu, click Start.



STATUS
This behavior is by design.



Steps to reproduce the behavior

 * 1) In Microsoft Visual Basic 6.0, start a new Standard EXE project.

By default, Form1 is created.
 * 1) On the Project menu, click Add Form.
 * 2) In the Add Form dialog box, click Visual Basic Data Form Wizard, and then click Open.
 * 3) In the Data Form Wizard - Introduction dialog box, click Next.
 * 4) In the Data Form Wizard - Database Type dialog box, click Next.
 * 5) In the Data Form Wizard - Database dialog box, click Browse.
 * 6) In the Access Database dialog box, locate the Northwind.mdb file.

Note The Northwind.mdb file is located in the %Program Files%Microsoft Office\Office10\Samples folder.
 * 1) Click the Northwind.mdb file, and then click Open.
 * 2) In the Data Form Wizard - Database dialog box, click Next.
 * 3) In the Data Form Wizard - Form dialog box, click Next.
 * 4) In the Data Form Wizard - Record Source dialog box, click to select Categories in the Record Source box, and then click >>.
 * 5) Click Next.
 * 6) In the Data Form Wizard - Control Selection dialog box, click Finish.
 * 7) On the Run menu, click Start.

You receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article.

