Article ID: 193326 - Last Review: March 14, 2005 - Revision: 2.2 BUG: Data Form Wizard Through Application Wizard Omits ADO ReferenceThis article was previously published under Q193326 On This PageSYMPTOMS
When you run an application that is created using the Visual Basic Application Wizard, you receive the following error message:
Compile error: User-defined type not defined
CAUSE
The Application Wizard allows for the creation of forms via the Data Form
Wizard. When a form is created in this manner, a reference to ADO is not
added to the project.
RESOLUTION
Add a reference to ADO by selecting References from the Project menu and
checking the box next to "Microsoft ActiveX Data Objects Library." This problem can also be avoided by running through the Application Wizard without adding any data forms, then adding data forms by invoking the Data Form Wizard directly from the Add-Ins menu. In versions of Visual Basic 6 prior to Service Pack 4, the ADO Data Control's events were designed to work only with ADO version 2.0. After you set a Reference to ADO later than 2.0 to workaround the Application Wizard problem, you receive the following error message
Compile Error:
Procedure declaration does not match description of event or procedure having the same name.
Specifically, change the following event procedure: Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset20) Private Sub datPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) Private Sub datPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset20) STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. MORE INFORMATIONSteps to Reproduce Behavior
REFERENCESFor additional information Compile error: Procedure declaration does not match description of event or procedure having the same name, click the article number below
to view the article in the Microsoft Knowledge Base:
222145
(http://support.microsoft.com/kb/222145/EN-US/
)
PRB: ADO Data Control Events May Generate a Compilation Error
APPLIES TO
| Article Translations
|
Back to the top
