VB hates its own event proc syntax???

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

    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


  • preben nielsen

    #2
    Re: VB hates its own event proc syntax???


    "Perion" <RazroRog@hotma il.com> skrev i en meddelelse
    news:0rudnW8EP6 [email protected]. ..
    [color=blue]
    > Now - show me how stupid I am (cause I know it's some idiotic[/color]
    deal on my part).

    Show your code....


    --
    /\ preben nielsen
    \/\ [email protected]. dk


    Comment

    • mayayana

      #3
      Re: VB hates its own event proc syntax???

      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 <RazroRog@hotma il.com> wrote in message
      news:0rudnW8EP6 [email protected]. ..[color=blue]
      > I have a simple form with, among other things, an ADODC data control[/color]
      (called[color=blue]
      > "Adodc1"). The ADO connection to the database tests fine but when I try to[/color]
      add[color=blue]
      > code to any of the Adodc1 control's event procs and then run the app I get[/color]
      a[color=blue]
      > compiler error:
      >
      > "Procedure declaration does not match description of event or procedure[/color]
      having[color=blue]
      > 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[/color]
      signature[color=blue]
      > (the number and types of parameters)."
      >
      > IMO, this is pretty weird since it was VB6 that generated the freekin'[/color]
      event[color=blue]
      > proc declaration in the first place; in the code window when I selected[/color]
      the[color=blue]
      > 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[/color]
      Adodc1[color=blue]
      > events and all give me the same error. Event procs for the other form[/color]
      controls[color=blue]
      > work fine.
      >
      > Now - show me how stupid I am (cause I know it's some idiotic deal on my[/color]
      part).[color=blue]
      >
      > Perion
      >
      >[/color]


      Comment

      • Bob Butler

        #4
        Re: VB hates its own event proc syntax???

        "Perion" <RazroRog@hotma il.com> wrote in message news:<0rudnW8EP [email protected]> ...[color=blue]
        > 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."[/color]

        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.

        Comment

        • Perion

          #5
          Re: VB hates its own event proc syntax???

          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:


          Thanks again to all for the replies.

          Regards,
          Perion


          "Bob Butler" <butlerbob@eart hlink.net> wrote in message
          news:fa10fb0.04 04091655.2e298a [email protected] le.com...[color=blue]
          > "Perion" <RazroRog@hotma il.com> wrote in message[/color]
          news:<0rudnW8EP [email protected]> ...[color=blue][color=green]
          > > 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[/color][/color]
          add[color=blue][color=green]
          > > 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[/color][/color]
          having[color=blue][color=green]
          > > the same name."[/color]
          >
          > 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.[/color]


          Comment

          Working...