469,167 Members | 1,154 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,167 developers. It's quick & easy.

VB hates its own event proc syntax???

I have a simple form with, among other things, an ADODC data control (called
"Adodc1"). The ADO connection to the database tests fine but when I try to add
code to any of the Adodc1 control's event procs and then run the app I get a
compiler error:

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

On clicking Help for the error it says:

"Procedure has the same name as an event but does not have the same signature
(the number and types of parameters)."

IMO, this is pretty weird since it was VB6 that generated the freekin' event
proc declaration in the first place; in the code window when I selected the
event in the drop down box. Its like VB6 doesn't like its own generated
procedure syntax. I looked up the event proc declaration in MSDN and it's
identical to what VB is generating. I tried this with several of the Adodc1
events and all give me the same error. Event procs for the other form controls
work fine.

Now - show me how stupid I am (cause I know it's some idiotic deal on my part).

Perion
Jul 17 '05 #1
4 8268

"Perion" <Ra******@hotmail.com> skrev i en meddelelse
news:0r********************@comcast.com...
Now - show me how stupid I am (cause I know it's some idiotic

deal on my part).

Show your code....
--
/\ preben nielsen
\/\ pr**@post.tele.dk
Jul 17 '05 #2
It sounds like you accidentally named one of your own
functions with the same name as a control event and VB
is complaining because your parameters don't match the
event parameters. Isn't VB pointing out which one it is
when you crash?

--
--
Perion <Ra******@hotmail.com> wrote in message
news:0r********************@comcast.com...
I have a simple form with, among other things, an ADODC data control (called "Adodc1"). The ADO connection to the database tests fine but when I try to add code to any of the Adodc1 control's event procs and then run the app I get a compiler error:

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

On clicking Help for the error it says:

"Procedure has the same name as an event but does not have the same signature (the number and types of parameters)."

IMO, this is pretty weird since it was VB6 that generated the freekin' event proc declaration in the first place; in the code window when I selected the event in the drop down box. Its like VB6 doesn't like its own generated
procedure syntax. I looked up the event proc declaration in MSDN and it's
identical to what VB is generating. I tried this with several of the Adodc1 events and all give me the same error. Event procs for the other form controls work fine.

Now - show me how stupid I am (cause I know it's some idiotic deal on my part).
Perion

Jul 17 '05 #3
"Perion" <Ra******@hotmail.com> wrote in message news:<0r********************@comcast.com>...
I have a simple form with, among other things, an ADODC data control (called
"Adodc1"). The ADO connection to the database tests fine but when I try to add
code to any of the Adodc1 control's event procs and then run the app I get a
compiler error:

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


somewhere along the line with ADO the event procedures definitions
were changed. Adding the ADODC adds a reference to ADO 2.0 (if I
remember correctly - I haven't used the control in years and then it
was only to play with it). The first thing I'd do is check project /
references and ensure you have only one ADO version checked.

Once that is set, find one of the event procedures and change the name
in the code (just append an X or something like that to the procedure
name). Then re-select the control and the event from the drop-downs
and let VB create a new event template and compare the argument lists.
You may be able to just move your code from the old procedure to the
new one and then delete the old one.
Jul 17 '05 #4
Thanx Bob. I found the solution to this somewhat by accident and you were pretty
close. Upgrading to MDAC 2.8 and installing Visual Studio SP6 solved the
problem. The culprit (I think) was the flaky nature of the ADODC control in ADO
2.0. Now the reference is set to ADO 2.5 and everything works.

Actually, I'm only using that ADODC control as a demo - ordinarily I have no use
for it. It just surprised me when I tried to use it and the problem that arose.

For reference in case anyone else ever encounters this problem - the downloads
for MDAC 2.8 and Visual Studio SP6 are at:
http://msdn.microsoft.com/data/downl...s/default.aspx

Thanks again to all for the replies.

Regards,
Perion
"Bob Butler" <bu*******@earthlink.net> wrote in message
news:fa*************************@posting.google.co m...
"Perion" <Ra******@hotmail.com> wrote in message

news:<0r********************@comcast.com>...
I have a simple form with, among other things, an ADODC data control (called
"Adodc1"). The ADO connection to the database tests fine but when I try to add code to any of the Adodc1 control's event procs and then run the app I get a
compiler error:

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


somewhere along the line with ADO the event procedures definitions
were changed. Adding the ADODC adds a reference to ADO 2.0 (if I
remember correctly - I haven't used the control in years and then it
was only to play with it). The first thing I'd do is check project /
references and ensure you have only one ADO version checked.

Once that is set, find one of the event procedures and change the name
in the code (just append an X or something like that to the procedure
name). Then re-select the control and the event from the drop-downs
and let VB create a new event template and compare the argument lists.
You may be able to just move your code from the old procedure to the
new one and then delete the old one.

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Derrick D. Daugherty | last post: by
2 posts views Thread by E.N. | last post: by
3 posts views Thread by hikums | last post: by
14 posts views Thread by aaron kempf | last post: by
3 posts views Thread by Groove | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.