You receive a "Compile error" 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

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 Librarycheck 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.
  4. On the Run menu, click
    Start.

Status

This behavior is by design.

More Information

Steps to reproduce the behavior

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

    By default, Form1 is created.
  2. On the Project menu, click Add Form.
  3. In the Add Form dialog box, click
    Visual Basic Data Form Wizard, and then click
    Open.
  4. In the Data Form Wizard - Introductiondialog box, click Next.
  5. In the Data Form Wizard - Database Typedialog box, click Next.
  6. In the Data Form Wizard - Database dialog box, click Browse.
  7. 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.
  8. Click the Northwind.mdb file, and then click Open.
  9. In the Data Form Wizard - Database dialog box, click Next.
  10. In the Data Form Wizard - Form dialog box, click Next.
  11. In the Data Form Wizard - Record Sourcedialog box, click to select Categories in the Record Source box, and then click >>.
  12. Click Next.
  13. In the Data Form Wizard - Control Selection dialog box, click Finish.
  14. On the Run menu, click
    Start.

    You receive the error message that is mentioned in the "Symptoms" section of this article.

References

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

171215 HOWTO: Use Data Form Wizard to connect to remote data via DAO


222145 PRB: ADO data control events may generate a compilation error


Propiedades

Id. de artículo: 827049 - Última revisión: 18 dic. 2003 - Revisión: 1

Comentarios