I am trying to update a database, and i am getting the following error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/bookseat_process.asp, line 25, column 16
UPDATE tblseats SET status='',cust_forename='',cust_surname='',cust_bo ok_id='',cust_address='',cust_postcode='',cust_are a_code='',cust_tel_number='',cust_cc='' WHERE seat = '" & Request.Querystring("seat") & "'
here is the full script for the page:
Code:
<html>
<head>
<title>ADO - Submit DataBase Record</title>
</head>
<body>
<h2>Submit to Database</h2>
<%
'on error resume next
set conn=Server.CreateObject("ADODB.Connection")
conn.provider="Microsoft.Jet.OLEDB.4.0"
conn.open(server.mappath("show1.mdb"))
if Request.querystring("action")<>"Save" then
seat=Request.Form("seat")
'sql="UPDATE tblseats SET status='" & Request.Form("status") & "',"
UPDATE tblseats SET status='',cust_forename='',cust_surname='',cust_book_id='',cust_address='',cust_postcode='',cust_area_code='',cust_tel_number='',cust_cc='' WHERE seat = '" & Request.Querystring("seat") & "'"
sql=sql & "cust_forename='" & Request.Form("cust_forename") & "',"
sql=sql & "cust_surname='" & Request.Form("cust_surname") & "',"
sql=sql & "cust_book_id='" & Request.Form("cust_book_id") & "',"
sql=sql & "cust_address='" & Request.Form("cust_address") & "',"
sql=sql & "cust_postcode='" & Request.Form("cust_postcode") & "',"
sql=sql & "cust_area_code='" & Request.Form("cust_area_code") & "',"
sql=sql & "cust_tel_number='" & Request.Form("cust_tel_number") & "',"
sql=sql & "cust_cc='" & Request.Form("cust_cc") & "',"
'sql=sql & "cust_cc='" & now() & "' WHERE tblseats.seat=" & no
conn.Execute sql, Recordsaffected
Response.Write(sql)
if err <> 0 then
Response.Write("You do not have permission to update this database!")
'else
'Response.Write("Record number " & no & " was updated.")
end if
'Response.Redirect("showavail.asp")
end if
'if Request.Form("action")="Delete" then
'no=Request.Form("no")
' conn.Execute "DELETE FROM tblGuestBook WHERE tblGuestBook.[no]=" & no, Recordsaffected
' if err <> 0 then
' Response.Write("You do not have permission to delete a record from this database!")
' else
' Response.Write("Record number " & no & " was deleted.")
' end if
'Response.Write("Deleting records has been disabled from this demo")
'end if
conn.close%>
</body>
</html>