W
woody22
Ive come up with an online room booking system which sends e mail vi
CDONTS fine but i get the following error message when i try to send t
a database too!! I cant for the life of me work out whats wrong with th
sql code ive done as ive used exactly the same code for another syste
and it works fine!! arghh!! Help Please!
Error Code
Code
-------------------
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/Room_Bookings/bookingconfirmation.asp, line 35
& "'"&projector&"', '"&headphones&"', '"&support&"')"
----------------------^
-------------------
SQL CODE
Code
-------------------
<%
staffname=Replace(Request.Form("staffname"), "'", "''")
email=Replace(Request.Form("email"), "'", "''")
subject=Request.Form("subject")
classyear=Replace(Request.Form("classyear"), "'", "''")
date=Replace(Request.Form("date") , "'", "''")
periods=Replace(Request.Form("periods") , "'", "''")
projector=Request.Form("projector")
headphones=Request.Form("headphones")
support=Request.Form("support")
if staffname="" then staffname=" "
if email="" then email=" "
if subject="" then subject=" "
if classyear="" then classyear=" "
if date="" then date=" "
if periods="" then periods=" "
if projector="" then projector=" "
if headphones="" then headphones=" "
if support="" then support=" "
Set MyConn=Server.CreateObject("ADODB.Connection")
ConnStr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("roombookings.mdb")
SQL = "Insert Into bookingdetails (staffname, email, subject, " _
& "classyear, date, periods, " _
& "projector, headphones, support) Values ('"&staffname&"', '"&email&"', '"&subject&"', " _
& "'"&classyear&"', '"&date&"', '"&periods&"', " _
& "'"&projector&"', '"&headphones&"', '"&support&"')"
MyConn.Open connStr
MyConn.Execute (SQL)
MyConn.Close
Set MyConn = Nothing
%>
CDONTS fine but i get the following error message when i try to send t
a database too!! I cant for the life of me work out whats wrong with th
sql code ive done as ive used exactly the same code for another syste
and it works fine!! arghh!! Help Please!
Error Code
Code
-------------------
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/Room_Bookings/bookingconfirmation.asp, line 35
& "'"&projector&"', '"&headphones&"', '"&support&"')"
----------------------^
-------------------
SQL CODE
Code
-------------------
<%
staffname=Replace(Request.Form("staffname"), "'", "''")
email=Replace(Request.Form("email"), "'", "''")
subject=Request.Form("subject")
classyear=Replace(Request.Form("classyear"), "'", "''")
date=Replace(Request.Form("date") , "'", "''")
periods=Replace(Request.Form("periods") , "'", "''")
projector=Request.Form("projector")
headphones=Request.Form("headphones")
support=Request.Form("support")
if staffname="" then staffname=" "
if email="" then email=" "
if subject="" then subject=" "
if classyear="" then classyear=" "
if date="" then date=" "
if periods="" then periods=" "
if projector="" then projector=" "
if headphones="" then headphones=" "
if support="" then support=" "
Set MyConn=Server.CreateObject("ADODB.Connection")
ConnStr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("roombookings.mdb")
SQL = "Insert Into bookingdetails (staffname, email, subject, " _
& "classyear, date, periods, " _
& "projector, headphones, support) Values ('"&staffname&"', '"&email&"', '"&subject&"', " _
& "'"&classyear&"', '"&date&"', '"&periods&"', " _
& "'"&projector&"', '"&headphones&"', '"&support&"')"
MyConn.Open connStr
MyConn.Execute (SQL)
MyConn.Close
Set MyConn = Nothing
%>