simple script not working with UPDATE

Discussion in 'ASP General' started by Jeff, Sep 14, 2004.

  1. Jeff

    Jeff Guest

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

    var1a = Request.Form("h1")
    var1b = Request.Form("h2")

    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
     
    Jeff, Sep 14, 2004
    #1
    1. Advertising

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

    var1a = Request.Form("h1")
    var1b = Request.Form("h2")

    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:
    http://groups.google.com/groups?q=odbc deprecated&meta=group=microsoft.public.inetserver.asp.db
    and
    http://groups.google.com/groups?q=b...meta=group=microsoft.public.inetserver.asp.db

    Ray at work



    "Jeff" <> wrote in message
    news:Oi%...
    > ok.... i dont know why this wont work. this is going to access DB on web.
    >
    > var1a = Request.Form("h1")
    > var1b = Request.Form("h2")
    >
    > 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], Sep 14, 2004
    #2
    1. Advertising

  3. Jeff

    Jeff Guest

    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:%...
    > Always, always, always, always, always, always first response.write your

    sql
    > string to find out what's going on.
    >
    > var1a = Request.Form("h1")
    > var1b = Request.Form("h2")
    >
    > 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:
    >

    http://groups.google.com/groups?q=odbc deprecated&meta=group=microsoft.public.inetserver.asp.db
    > and
    >

    http://groups.google.com/groups?q=b...meta=group=microsoft.public.inetserver.asp.db
    >
    > Ray at work
    >
    >
    >
    > "Jeff" <> wrote in message
    > news:Oi%...
    > > ok.... i dont know why this wont work. this is going to access DB on

    web.
    > >
    > > var1a = Request.Form("h1")
    > > var1b = Request.Form("h2")
    > >
    > > 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
    > >
    > >

    >
    >
     
    Jeff, Sep 14, 2004
    #3
  4. Jeff

    Jeff Guest

    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" <> wrote in message
    news:...
    > 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:%...
    > > Always, always, always, always, always, always first response.write your

    > sql
    > > string to find out what's going on.
    > >
    > > var1a = Request.Form("h1")
    > > var1b = Request.Form("h2")
    > >
    > > 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:
    > >

    >

    http://groups.google.com/groups?q=odbc deprecated&meta=group=microsoft.public.inetserver.asp.db
    > > and
    > >

    >

    http://groups.google.com/groups?q=b...meta=group=microsoft.public.inetserver.asp.db
    > >
    > > Ray at work
    > >
    > >
    > >
    > > "Jeff" <> wrote in message
    > > news:Oi%...
    > > > ok.... i dont know why this wont work. this is going to access DB on

    > web.
    > > >
    > > > var1a = Request.Form("h1")
    > > > var1b = Request.Form("h2")
    > > >
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Jeff, Sep 14, 2004
    #4
  5. "Jeff" <> wrote in message
    news:...
    > 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'


    Your text data needs to be delimited with the ' character.
    UPDATE matches SET team1a='batmasterson',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.




    > 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?


    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
     
    Ray Costanzo [MVP], Sep 14, 2004
    #5
  6. p.s. Also read this:

    http://www.aspfaq.com/show.asp?id=2035


    Ray at work

    "Jeff" <> wrote in message
    news:...
    > 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'
    >
     
    Ray Costanzo [MVP], Sep 14, 2004
    #6
  7. Jeff

    Jeff Guest

    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$...
    > p.s. Also read this:
    >
    > http://www.aspfaq.com/show.asp?id=2035
    >
    >
    > Ray at work
    >
    > "Jeff" <> wrote in message
    > news:...
    > > 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'
    > >

    >
     
    Jeff, Sep 14, 2004
    #7
  8. You're quite welcome! :]

    Ray at home

    "Jeff" <> wrote in message
    news:...
    > 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
     
    Ray Costanzo [MVP], Sep 15, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. geoffbache
    Replies:
    5
    Views:
    946
    geoffbache
    Jun 13, 2008
  2. Jacob N.
    Replies:
    0
    Views:
    99
    Jacob N.
    Dec 29, 2010
  3. dillon
    Replies:
    1
    Views:
    186
    higabe
    Nov 17, 2003
  4. lawrence
    Replies:
    8
    Views:
    259
    lawrence
    May 5, 2004
  5. AMT2K5
    Replies:
    2
    Views:
    148
    Tad McClellan
    Nov 27, 2005
Loading...

Share This Page