Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error

Status
Not open for further replies.

aarellano

MIS
Oct 22, 2007
168
US
Hello,
I got a syntax error and I have no idea where

my original code looks like this

Code:
SQL = "UPDATE diary SET dte =" & Request.Form("dte") & ", " &_
					" eTime= '"	& ChkStr(Request.Form("tim")) & "', " & _
					" text_field = '" & ChkStr(Request.Form("title")) & "', " &  _
					" details = '" & ChkStr(Request.Form("details")) & "', category = " & Request.Form("cat")  & _
					" WHERE id = " & Request.Form("ID")
				
				my_conn.Execute SQL

the new code looks like this I added the second to last line

Code:
SQL = "UPDATE diary SET dte =" & Request.Form("dte") & ", " &_
					" eTime= '"	& ChkStr(Request.Form("tim")) & "', " & _
					" text_field = '" & ChkStr(Request.Form("title")) & "', " &  _
					" details = '" & ChkStr(Request.Form("details")) & "', " &  _
					" category = '" & ChkStr(Request.Form("cat")) & "', image = " & Request.Form("image")  & _
					" WHERE id = " & Request.Form("ID")
				
				my_conn.Execute SQL

any help is always greatly appreciated it. This is driving me nuts!!!
 

Is 'image' a numeric field? If not you need the single quotes around the value
Code:
'...
 image = [red]'[/red]" & Request.Form("image")  & _
                    "[red]'[/red] WHERE id
'...

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
what platform is this sql for? oracle? microsoft?
if it's on microsoft, it should have # around the date, if i'm not mistaken, and single quotes around strings, and of course, spaces before and after them and numbers. how are date and time defined? if it's oracle, then you should convert the date string to DATE using TO_DATE function:
TO_DATE("date_string", 'MM/DD/YYYY')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top