Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaration error msg 1

Status
Not open for further replies.

antvon

Programmer
Dec 2, 2002
45
I have greated a VB6 project that has been working fine
for some time now. Unfortunately the harddrive that the project was located on crashed.

I managed to transfer the files over to a new machine, but
when I tried to run the program it came up with the following compile error message:

Procedure declaration does not match description of event or procedure having the same name.

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

I've copied the files to two other machines running win98 and win2K and it works fine. I've check references and everything else I can think of.

Any suggestions would be appreciated - thanks?
 
antvon

I have a suggestion. See if it works.

Comment the procedure. and again select the procedure from the procedure combo box located on the top of code window.
 
It generally means that you have 2 different procedures with the same name in the same module.

The code shown looks like a standard MS help example - could you have pasted it twice in the same form or code module?
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
bridamol : I have tried it. selecting it from the combobox does put it in the code , but still won't work

johnwm : Nope procedure only occurs once.The code was generated from the data form wizard. I have greated several
data forms that use to work fine and still does on two other machines but on my machine it won't work at all.

The code is an exact copy on the other pc's

To make matters worse I had win98 reinstalled on my original harddrive without effecting any of the code files and
this now gives me the same error as the current machine.

Does this sound like my problem is perhapes due to missing windows / dll files on the two machines. I just don't know

But thanks for the suggestions guys
if you think of anything else let me know.
 
This is a guess, but you might need to install/re-install MDAC on the malfunctioning computers.

HTH,
David
 
harebrain - yes think you're on to somthing..I upgraded to service pack 5 which i think upgrades some MDAC files as well.

Well what do you know. Works like a charm.

Many thanks to everyone
 
I am having the exact same problem only my event is:
Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

I read the response from haribrain. What is a MDAC and how do I reload it?

Thanks so much
Trudye
 
I remember where this error comes from...an earlier version of the ADODC/ADO didn't have this event. Change the references to the ADO library to ADO 2.5 or higher(PROJECT|REFERNECES). First remove reference to the currently select ADO library.

If you do not have this version of ADO on your system, then you can get it by updating to MDAC 2.5, or, better yet, upgrade to VB6 SP5 (
 
Hi CCLINT:

I had MS ACTIVEX Data Obj 2.5 lib in my Project/References already selected. I even moved it up in priority, could there be something else I'm missing? Here is what I have:
vb for Apps
vb runtime obj. and Proc
vb obj. and proc
MS ActiveX Data Obj. 2.5 lib
OLE Automation
MS Data Binding Collection
MS Data Formating Obj. lib

Thanks much,
Trudye
 
Are you also update to VB6 SP5? You will need to do this in order to have the correct version of the ADODC.
 
CClint:

Have a star. I've been working with Access VBA for a few years and decided I needed to learn VB6. Bought a book that told me to use the Data Form Wizard as an intro. The wizard wasn't in my Add-ins so I downloaded SP5 and installed it.

When I tried to run the form I created with the wizard I got the compile error Antvon described. Contacted the publisher, checked MSKB, nada.

You've saved my day. I unchecked the reference for 2.0 and set the reference to 2.5 and it now works as advertised.

If I could by you a beer or two we'd belly up to the bar.

Thanks again.

Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Thankyou. Happy to hear it works for you now.
And happy you posted your experience here for others to see also.

Tnaks for the beer! [cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top