simple script not working with UPDATE

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

    simple script not working with UPDATE

    ok.... i dont know why this wont work. this is going to access DB on web.

    var1a = Request.Form("h 1")
    var1b = Request.Form("h 2")

    strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = " & var1b & "
    WHERE ID = '1'"

    Conn.Execute (strSQL)

    looks good to me... but i get the following error


    Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2



    i dont know what it is looking for. let me know if you need more
    information. the field names are correct, the form field names are correct..
    already looked at that.

    Thanks for any help

    Jeff


  • Ray Costanzo [MVP]

    #2
    Re: simple script not working with UPDATE

    Always, always, always, always, always, always first response.write your sql
    string to find out what's going on.

    var1a = Request.Form("h 1")
    var1b = Request.Form("h 2")

    strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = " & var1b & "
    WHERE ID = '1'"
    RESPONSE.WRITE STRSQL
    RESPONSE.END

    Do you see what's expected, and does what's returned work in the query thing
    in Access itself?

    Also see:

    and


    Ray at work



    "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
    news:Oi%230Iamm EHA.3432@TK2MSF TNGP14.phx.gbl. ..[color=blue]
    > ok.... i dont know why this wont work. this is going to access DB on web.
    >
    > var1a = Request.Form("h 1")
    > var1b = Request.Form("h 2")
    >
    > strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = " & var1b &
    > "
    > WHERE ID = '1'"
    >
    > Conn.Execute (strSQL)
    >
    > looks good to me... but i get the following error
    >
    >
    > Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
    >
    > [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2
    >
    >
    >
    > i dont know what it is looking for. let me know if you need more
    > information. the field names are correct, the form field names are
    > correct..
    > already looked at that.
    >
    > Thanks for any help
    >
    > Jeff
    >
    >[/color]


    Comment

    • Jeff

      #3
      Re: simple script not working with UPDATE

      Thanks for the fast response. I should have mentioned that it did have the
      correct data when i did what you asked.
      UPDATE matches SET team1a = batmasterson, team1b = Billhickok WHERE ID = '1'

      I am not sure what you mean by working in access itself. Are you asking me
      to build a query in the access program? with the result of the write sql?

      Jeff

      "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
      message news:%23ToIadmm EHA.3452@TK2MSF TNGP15.phx.gbl. ..[color=blue]
      > Always, always, always, always, always, always first response.write your[/color]
      sql[color=blue]
      > string to find out what's going on.
      >
      > var1a = Request.Form("h 1")
      > var1b = Request.Form("h 2")
      >
      > strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = " & var1b &[/color]
      "[color=blue]
      > WHERE ID = '1'"
      > RESPONSE.WRITE STRSQL
      > RESPONSE.END
      >
      > Do you see what's expected, and does what's returned work in the query[/color]
      thing[color=blue]
      > in Access itself?
      >
      > Also see:
      >[/color]
      http://groups.google.com/groups?q=od...tserver.asp.db[color=blue]
      > and
      >[/color]
      http://groups.google.com/groups?q=bo...tserver.asp.db[color=blue]
      >
      > Ray at work
      >
      >
      >
      > "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
      > news:Oi%230Iamm EHA.3432@TK2MSF TNGP14.phx.gbl. ..[color=green]
      > > ok.... i dont know why this wont work. this is going to access DB on[/color][/color]
      web.[color=blue][color=green]
      > >
      > > var1a = Request.Form("h 1")
      > > var1b = Request.Form("h 2")
      > >
      > > strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = " & var1b[/color][/color]
      &[color=blue][color=green]
      > > "
      > > WHERE ID = '1'"
      > >
      > > Conn.Execute (strSQL)
      > >
      > > looks good to me... but i get the following error
      > >
      > >
      > > Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
      > >
      > > [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2
      > >
      > >
      > >
      > > i dont know what it is looking for. let me know if you need more
      > > information. the field names are correct, the form field names are
      > > correct..
      > > already looked at that.
      > >
      > > Thanks for any help
      > >
      > > Jeff
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Jeff

        #4
        Re: simple script not working with UPDATE

        Ok. I did put the returned info into access... when it ran.. it asked me for
        parameters for the names that were there. which is weird. the names
        themselves are what should have been put into the correct fields.


        "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
        news:OP1YqhmmEH A.1656@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Thanks for the fast response. I should have mentioned that it did have the
        > correct data when i did what you asked.
        > UPDATE matches SET team1a = batmasterson, team1b = Billhickok WHERE ID =[/color]
        '1'[color=blue]
        >
        > I am not sure what you mean by working in access itself. Are you asking me
        > to build a query in the access program? with the result of the write sql?
        >
        > Jeff
        >
        > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
        > message news:%23ToIadmm EHA.3452@TK2MSF TNGP15.phx.gbl. ..[color=green]
        > > Always, always, always, always, always, always first response.write your[/color]
        > sql[color=green]
        > > string to find out what's going on.
        > >
        > > var1a = Request.Form("h 1")
        > > var1b = Request.Form("h 2")
        > >
        > > strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = " & var1b[/color][/color]
        &[color=blue]
        > "[color=green]
        > > WHERE ID = '1'"
        > > RESPONSE.WRITE STRSQL
        > > RESPONSE.END
        > >
        > > Do you see what's expected, and does what's returned work in the query[/color]
        > thing[color=green]
        > > in Access itself?
        > >
        > > Also see:
        > >[/color]
        >[/color]
        http://groups.google.com/groups?q=od...tserver.asp.db[color=blue][color=green]
        > > and
        > >[/color]
        >[/color]
        http://groups.google.com/groups?q=bo...tserver.asp.db[color=blue][color=green]
        > >
        > > Ray at work
        > >
        > >
        > >
        > > "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
        > > news:Oi%230Iamm EHA.3432@TK2MSF TNGP14.phx.gbl. ..[color=darkred]
        > > > ok.... i dont know why this wont work. this is going to access DB on[/color][/color]
        > web.[color=green][color=darkred]
        > > >
        > > > var1a = Request.Form("h 1")
        > > > var1b = Request.Form("h 2")
        > > >
        > > > strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = " &[/color][/color][/color]
        var1b[color=blue]
        > &[color=green][color=darkred]
        > > > "
        > > > WHERE ID = '1'"
        > > >
        > > > Conn.Execute (strSQL)
        > > >
        > > > looks good to me... but i get the following error
        > > >
        > > >
        > > > Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
        > > >
        > > > [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected[/color][/color][/color]
        2[color=blue][color=green][color=darkred]
        > > >
        > > >
        > > >
        > > > i dont know what it is looking for. let me know if you need more
        > > > information. the field names are correct, the form field names are
        > > > correct..
        > > > already looked at that.
        > > >
        > > > Thanks for any help
        > > >
        > > > Jeff
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Ray Costanzo [MVP]

          #5
          Re: simple script not working with UPDATE


          "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
          news:OP1YqhmmEH A.1656@TK2MSFTN GP09.phx.gbl...[color=blue]
          > Thanks for the fast response. I should have mentioned that it did have the
          > correct data when i did what you asked.
          > UPDATE matches SET team1a = batmasterson, team1b = Billhickok WHERE ID =
          > '1'[/color]

          Your text data needs to be delimited with the ' character.
          UPDATE matches SET team1a='batmast erson',team1b=' Billhickok' WHERE ID='1'"
          And is your ID really NOT a numeric field? The fact that you have that
          delimited with the ' implies that it is not. That's odd, if so, I'd say.



          [color=blue]
          > I am not sure what you mean by working in access itself. Are you asking me
          > to build a query in the access program? with the result of the write sql?[/color]

          No, meaning, you can copy and paste the result of the Response.Write sql
          into the query window in Access and run it to see what happens in there.

          Ray at work


          Comment

          • Ray Costanzo [MVP]

            #6
            Re: simple script not working with UPDATE

            p.s. Also read this:




            Ray at work

            "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
            news:OP1YqhmmEH A.1656@TK2MSFTN GP09.phx.gbl...[color=blue]
            > Thanks for the fast response. I should have mentioned that it did have the
            > correct data when i did what you asked.
            > UPDATE matches SET team1a = batmasterson, team1b = Billhickok WHERE ID =
            > '1'
            >[/color]

            Comment

            • Jeff

              #7
              Re: simple script not working with UPDATE

              Ok. I got it to work now.. i did leave the ' out.. and as fr as the ID.. it
              should have been a number.. not sure why it wasn't.. but both of those
              solved it for me.
              thanks a million for your help
              Jeff


              "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
              message news:ev$bRnmmEH A.3756@TK2MSFTN GP11.phx.gbl...[color=blue]
              > p.s. Also read this:
              >
              > http://www.aspfaq.com/show.asp?id=2035
              >
              >
              > Ray at work
              >
              > "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
              > news:OP1YqhmmEH A.1656@TK2MSFTN GP09.phx.gbl...[color=green]
              > > Thanks for the fast response. I should have mentioned that it did have[/color][/color]
              the[color=blue][color=green]
              > > correct data when i did what you asked.
              > > UPDATE matches SET team1a = batmasterson, team1b = Billhickok WHERE ID =
              > > '1'
              > >[/color]
              >[/color]


              Comment

              • Ray Costanzo [MVP]

                #8
                Re: simple script not working with UPDATE

                You're quite welcome! :]

                Ray at home

                "Jeff" <gig_bam_takeme out_@verizon.ne t> wrote in message
                news:u8W9p4mmEH A.324@TK2MSFTNG P11.phx.gbl...[color=blue]
                > Ok. I got it to work now.. i did leave the ' out.. and as fr as the ID..[/color]
                it[color=blue]
                > should have been a number.. not sure why it wasn't.. but both of those
                > solved it for me.
                > thanks a million for your help[/color]


                Comment

                Working...