SQL Update

S

Steve G

Hi Using the ASP text below I get the following error message. Any help
would be appreciated.
I'm using FP2002 to an IIS server. Using the DRW creates problems in other
areas, so I reverted to ASP.

Thanks, Steve G.

'====== ASP code to create the SQL to Update the target record=========
SQL = "Update extra (GNUM,GDATE,Ref,name,jersey,team,type,detail) VALUES
('" & _
Session("sGNUM") & "','" &_
Session("sGDATE") & "','" &_
Session("sRef") & "','" &_
Request.Form("Name") & "','" &_
Request.Form("JerseyNum")& "','" &_
Request.Form("Team") & "','" &_
Request.Form("R1") & "','" &_
Request.Form("Detail") & "')" &_
" where id ='" & uid & "'"
=====response.write sql ==== debug stmt that gives me this (which looks
OK - I think):

Update extra (GNUM,GDATE,Ref,name,jersey,team,type,detail) VALUES
('1244','1/1/10','Any Name','John Doe','02','Home Team','Ejection','Delay
Restart') where id ='711'

=====Conn.Execute(sql) ====gives me this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/members/GameRpt/EditCard2.asp, line 29
 
J

Jon

Hi Steve,

No - an update should look like this
UPDATE Table SET
Field1 = Value,
Field2 = Value
WHERE ID = ID

Can you see how to re-write yours now?

Jon
microsoft MVP - FP
 
K

Kevin Spencer

Of course, he DID use the correct syntax for an INSERT statement (except for
the word "UPDATE"). ;-)

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Jon said:
Hi Steve,

No - an update should look like this
UPDATE Table SET
Field1 = Value,
Field2 = Value
WHERE ID = ID

Can you see how to re-write yours now?

Jon
microsoft MVP - FP
Steve G said:
Hi Using the ASP text below I get the following error message. Any help
would be appreciated.
I'm using FP2002 to an IIS server. Using the DRW creates problems in other
areas, so I reverted to ASP.

Thanks, Steve G.

'====== ASP code to create the SQL to Update the target record=========
SQL = "Update extra (GNUM,GDATE,Ref,name,jersey,team,type,detail) VALUES
('" & _
Session("sGNUM") & "','" &_
Session("sGDATE") & "','" &_
Session("sRef") & "','" &_
Request.Form("Name") & "','" &_
Request.Form("JerseyNum")& "','" &_
Request.Form("Team") & "','" &_
Request.Form("R1") & "','" &_
Request.Form("Detail") & "')" &_
" where id ='" & uid & "'"
=====response.write sql ==== debug stmt that gives me this (which looks
OK - I think):

Update extra (GNUM,GDATE,Ref,name,jersey,team,type,detail) VALUES
('1244','1/1/10','Any Name','John Doe','02','Home Team','Ejection','Delay
Restart') where id ='711'

=====Conn.Execute(sql) ====gives me this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/members/GameRpt/EditCard2.asp, line 29
 
S

Steve G

You guys are great. Thanks for the quick response.
I tried that format earlier, but was getting a "Data Type Mismatch"
All fields in the database are "text" EXCEPT for the autonum (ID).

When I used your format AND remove the parenthesis from around the uid it
worked.

Thank you, thank you. Steve G.

Jon said:
Hi Steve,

No - an update should look like this
UPDATE Table SET
Field1 = Value,
Field2 = Value
WHERE ID = ID

Can you see how to re-write yours now?

Jon
microsoft MVP - FP
Steve G said:
Hi Using the ASP text below I get the following error message. Any help
would be appreciated.
I'm using FP2002 to an IIS server. Using the DRW creates problems in other
areas, so I reverted to ASP.

Thanks, Steve G.

'====== ASP code to create the SQL to Update the target record=========
SQL = "Update extra (GNUM,GDATE,Ref,name,jersey,team,type,detail) VALUES
('" & _
Session("sGNUM") & "','" &_
Session("sGDATE") & "','" &_
Session("sRef") & "','" &_
Request.Form("Name") & "','" &_
Request.Form("JerseyNum")& "','" &_
Request.Form("Team") & "','" &_
Request.Form("R1") & "','" &_
Request.Form("Detail") & "')" &_
" where id ='" & uid & "'"
=====response.write sql ==== debug stmt that gives me this (which looks
OK - I think):

Update extra (GNUM,GDATE,Ref,name,jersey,team,type,detail) VALUES
('1244','1/1/10','Any Name','John Doe','02','Home Team','Ejection','Delay
Restart') where id ='711'

=====Conn.Execute(sql) ====gives me this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/members/GameRpt/EditCard2.asp, line 29
 

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

Top