Corrupted OCA file???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alanrn

    #1

    Corrupted OCA file???

    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_Mo veComplete(_
    ByVal adReason As ADODB.EventReas onEnum, _
    ByVal pError As ADODB.Error, adStatus As ADODB.EventStat usEnum, _
    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(ad Reason 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_Mo veComplete( _
    ByVal adReason As ADODB.EventReas onEnum, _
    ByVal pError As ADODB.Error, adStatus As ADODB.EventStat usEnum, _
    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\Syste m32\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
    something...!)

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

    ..ARN.
  • alanrn

    #2
    Re: Corrupted OCA file???

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

    ..ARN.

    CrackpotUK@hotm ail.com (Geoff) wrote in message news:<79ce14a8. 0307141459.3b73 1e65@posting.go ogle.com>...[color=blue]
    > 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
    > HTH
    > Geoff
    > --
    >[/color]

    Comment

    Working...