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.
To work around this new compile error, you must change the declaration of the ADO Data Control's events to include ADODB.Recordset20 instead of ADODB.Recordset.
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)
-to-
Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset20)
And change:
Private Sub datPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
-to-
Private Sub datPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset20)
When you use Visual Basic 6 Service Pack 4, the ADO Data Control's events work with ADO versions 2.1 and later. It is not necessary to change the
pRecordset arguments to ADODB.Recordset20.