pnj
Nov 19th, 2000, 11:42 AM
this should be simple but.......
I have an ASP page that has a form w/ four text fields and on hidden field. it calls a page called update that has this code in it.
++++++++++++++++++++++
dim FN,LN,EM,PN,SH
FN = request.form("theDate") 'date of the event
LN = request.form("location")'location of the event
EM = request.form("hours") 'time of the event
PN = request.form("title") 'main heading for event(title)
SH = request.form("description")'text describing the event w/ some detail
PW = request.form("ID")
SQL = "Update main_event set date='" & FN & "', location='" & LN & "'"
SQL = SQL & ", heading='" & EM & "', event='" & PN & "'" & _
", hours='" & SH & "', Password='" & PW & "' where ID =" & request.form("id")
response.write SQl 'for testing
set conn = server.createobject("ADODB.Connection")
conn.open "pnj" 'DSN is pnj
conn.execute SQl
conn.close
set conn = nothing
++++++++++++++++++++
the error I get is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
it says there is an error on line 16 (conn.execute sql)
does anyone see anything wrong w/ this?
the really strange thing is this code I took from another project and that project would work fine. I know I am just overlooking something simple.....
thanks
I have an ASP page that has a form w/ four text fields and on hidden field. it calls a page called update that has this code in it.
++++++++++++++++++++++
dim FN,LN,EM,PN,SH
FN = request.form("theDate") 'date of the event
LN = request.form("location")'location of the event
EM = request.form("hours") 'time of the event
PN = request.form("title") 'main heading for event(title)
SH = request.form("description")'text describing the event w/ some detail
PW = request.form("ID")
SQL = "Update main_event set date='" & FN & "', location='" & LN & "'"
SQL = SQL & ", heading='" & EM & "', event='" & PN & "'" & _
", hours='" & SH & "', Password='" & PW & "' where ID =" & request.form("id")
response.write SQl 'for testing
set conn = server.createobject("ADODB.Connection")
conn.open "pnj" 'DSN is pnj
conn.execute SQl
conn.close
set conn = nothing
++++++++++++++++++++
the error I get is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
it says there is an error on line 16 (conn.execute sql)
does anyone see anything wrong w/ this?
the really strange thing is this code I took from another project and that project would work fine. I know I am just overlooking something simple.....
thanks