473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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_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
something...!)

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

..ARN.
Jul 17 '05 #1
1 4389
No, the wizard did not generate that line. However, when I added it
myself the code worked! Thanks.

..ARN.

Cr********@hotmail.com (Geoff) wrote in message news:<79**************************@posting.google. 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
HTH
Geoff
--

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: r.e.s. | last post by:
No matter which site I download it from, NumTut.tgz appears to be corrupted. Anyone else having this problem? Thanks. -- r.e.s.
1
by: WKC | last post by:
Recently, one of our database's mdf and ldf was corrupted. We were able to bring back the database with the capability of importing and querying the data. However, the data is not the full list. ...
2
by: Byron | last post by:
I am uploading a JPG file using FTP to a remote server and often the file is corrupted at the server end. The file size is the same, but the image often has a block of garbage embedded, or the...
3
by: Bob Hynes | last post by:
Hi All, Does anyone know of a place where a corrupted mdb(front-end) can be sent and have that place be able to tell me what got corrupted within the db? Here's the issue; All pc's are WindowsNT...
28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
9
by: advance scout | last post by:
HELP! My database is suddenly corrupted. My computer was acting funny (very sluggish) and was shut down. Access had been already been closed down but computer was acting very slow , so perhaps it...
3
by: Jeremy Chaney | last post by:
It appears that my user.config file got corrupted causing my "InitializeComponent" routine to throw the exception "Root element is missing." when I start my app. I figure I can just go into...
7
by: jc | last post by:
i'm developing a project using vc++. the main exe is a win32 application. it needs two dlls. one is my own implementation of string operations. the other dll is to parse a2l files(it is similar to...
4
by: =?Utf-8?B?U1VOTlk=?= | last post by:
Hi, i am uploading a .docx file into sql2005 and later when i retrieve the file from the database and i open it, i get a error message "The file is corrupted and cannot be open". I am not facing...
1
ddtpmyra
by: ddtpmyra | last post by:
When Im downloading a file from mysql database the file is already corrupted below are the code I used on downloading to mysql and uploading from mysql. PDF file are doing okay as long as it is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.