By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,157 Members | 891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,157 IT Pros & Developers. It's quick & easy.

Corrupted OCA file???

P: n/a
Is it possible for OCA files to become corrupt? If so, how and what
can one do to "repair" them? Or, perhaps, there are other nefarious
forces at work here? :-(

Here are the particulars of my question. Yesterday I was working
through Wrox's "Visual Basic 6 Database Programing" for the second
time. A description of using the Data Form Wizard is given in chapter
2. However, after working through the example and pressign F5 to run
the app, I got the following compile error in a dialog box: "Procedure
declaration does not match description of event or procedure having
the same name."

The following shows the function declaration generated by the wizard
(I've split it over multiple lines for readability):

Private Sub datPrimaryRS_MoveComplete(_
ByVal adReason As ADODB.EventReasonEnum, _
ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset)

So, I press F2 to go to the object browser and look up the syntax of
the MoveComplete event for the ADODC object and find the following:

Event MoveComplete(adReason As EventReasonEnum, pError As Error, _
adStatus As EventStatusEnum, pRecordset As Recordset)

Other than the (reasonable) ADODB prefix generated by the wizard the
two check out as being equivalent as far as I can tell.

So, my next move was to generate the sub description within native VB
(instead of using the wizard). I deleted the wizard-generated
MoveComplete sub and, instead, generated it by selecting the
MoveComplete event in the code window with the datPrimaryRS control
selected. (datPrimary RS is the name of the ADODC control that the
wizard generated.) This generated the following sub declaration:

Private Sub datPrimaryRS_MoveComplete( _
ByVal adReason As ADODB.EventReasonEnum, _
ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset)

This ends up being identical to the declaration that the wizard
generated; and, as expected, I got the same compilation error.

Checking further in the Object Browser, I found that the name of the
associated OCA file was "C:\WINNT\System32\MSADODC.oca". (I'm running
XP Pro.) Sure enough, the file is there, but what's interesting is
that it has a modification date of 6/17/03.

So, all of this leads to my questions?

1) What could cause the ADODC control to give me a compilation error
when I seem to be following the requisite syntax for the control?

2) Could my copy of MSADODC.oca be corrupted somehow?

3) Does anyone have any idea why the modifcation date for the OCA file
would be so recent when I installed Visual Studio on this computer
almost 2-1/2 years ago? (I don't remember doing anything significant
around that time, unless one of the automatic XP O/S updates did

Any answers to these questions as well as suggested solutions would be
greatly appreciated.

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
No, the wizard did not generate that line. However, when I added it
myself the code worked! Thanks.


Cr******** (Geoff) wrote in message news:<79************************** com>...
See if the Wizard has given you the events,
I don't know if it does declare them or not I can't remember
I use unbound recordsets no data controls now,
so I ain't used the data wizard in ages.
But in the General section at the top of your code
See if you have:-
Private WithEvents datPrimaryRS As ADODB.Recordset

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.