simple script not working with UPDATE

J

Jeff

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
 
R

Ray Costanzo [MVP]

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
 
J

Jeff

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

Ray at work



Jeff said:
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
 
J

Jeff

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 said:
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 said:
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=o...meta=group=microsoft.public.inetserver.asp.db
Ray at work
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
 
R

Ray Costanzo [MVP]

Jeff said:
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
 
J

Jeff

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top