The following is my code..... I was trying to accept users' feed back and save it to the database....
It works once and then keeps bringing the above error message...
(Microsoft..... Syntax error (Mission Operator)...).. .
COULD YOU PLEASE HELP ME OUT!!!
NOTE: All the fields in the database are of type TEXT...
Thank YOU!!!
<body>
<%
dim Ssection,stype, qn1,qn2,qn3,qn4 ,qn5,qn6,qn7,qn 8,qn9,qn10,qn11 ,qn12,qn13,qn14 ,qn15,qn16,qn17 ,sql
dim con,rs,filePath ,boolFound
Ssection=reques t.Form("Section ")
stype=Request.F orm("Stype")
qn1=Request.For m("Qnum1")
qn2=Request.For m("Qnum2")
qn3=Request.For m("Qnum3")
qn4=Request.For m("Qnum4")
qn5=Request.For m("Qnum5")
qn6=Request.For m("Qnum6")
qn7=Request.For m("Qnum7")
qn8=Request.For m("Qnum8")
qn9=Request.For m("Qnum9")
qn10=Request.Fo rm("Qnum10")
qn11=Request.Fo rm("Qnum11")
qn12=Request.Fo rm("Qnum12")
qn13=Request.Fo rm("Qnum13")
qn14=Request.Fo rm("Qnum14")
qn15=Request.Fo rm("Qnum15")
qn16=Request.Fo rm("Qnum16")
qn17=request.Fo rm("Qnum17")
'SELECT [fields] FROM [table] WHERE [expression]
'INSERT INTO [table] ([field1],...) VALUES ([value1],...) WHERE [expression]
'UPDATE [table] SET [field1]=[value1] WHERE [expression]
set con=Server.Crea teObject("ADODB .Connection")
set rs=Server.Creat eObject("ADODB. Recordset")
con.Provider="M icrosoft.Jet.OL EDB.4.0;"
filePath = Server.MapPath( "compute.md b")
con.Open "C:\inetpub\www root\CSF\Databa se\CSFSystem2.m db"
sql = "INSERT INTO [LastTable]([SSection],[SType],[QOne],[QTwo],[QThree],[Q4],[Q5],[Q6],[Q7],[Q8],[Q9],[Q10],[Q11],[Q12],[Q13],[Q14],[Q15],[Q16],[Q17]) values ('" + Ssection + "','" + stype + "','" + qn1 +"','" + qn2 + "','" + qn3 + "','" + qn4 + "','" + qn5 + "','" + qn6 + "','" + qn7 + "','" + qn8 + "','"+ qn9 + "','" + qn10 + "','" + qn11 + "','" + qn12 + "','" + qn13 + "','" + qn14 + "','" + qn15 + "','" + qn16 + "','" + qn17 + "')"
rs.open sql,con
<%
response.Redire ct("SuccessSave .html")
%>
</body>
</html>
It works once and then keeps bringing the above error message...
(Microsoft..... Syntax error (Mission Operator)...).. .
COULD YOU PLEASE HELP ME OUT!!!
NOTE: All the fields in the database are of type TEXT...
Thank YOU!!!
<body>
<%
dim Ssection,stype, qn1,qn2,qn3,qn4 ,qn5,qn6,qn7,qn 8,qn9,qn10,qn11 ,qn12,qn13,qn14 ,qn15,qn16,qn17 ,sql
dim con,rs,filePath ,boolFound
Ssection=reques t.Form("Section ")
stype=Request.F orm("Stype")
qn1=Request.For m("Qnum1")
qn2=Request.For m("Qnum2")
qn3=Request.For m("Qnum3")
qn4=Request.For m("Qnum4")
qn5=Request.For m("Qnum5")
qn6=Request.For m("Qnum6")
qn7=Request.For m("Qnum7")
qn8=Request.For m("Qnum8")
qn9=Request.For m("Qnum9")
qn10=Request.Fo rm("Qnum10")
qn11=Request.Fo rm("Qnum11")
qn12=Request.Fo rm("Qnum12")
qn13=Request.Fo rm("Qnum13")
qn14=Request.Fo rm("Qnum14")
qn15=Request.Fo rm("Qnum15")
qn16=Request.Fo rm("Qnum16")
qn17=request.Fo rm("Qnum17")
'SELECT [fields] FROM [table] WHERE [expression]
'INSERT INTO [table] ([field1],...) VALUES ([value1],...) WHERE [expression]
'UPDATE [table] SET [field1]=[value1] WHERE [expression]
set con=Server.Crea teObject("ADODB .Connection")
set rs=Server.Creat eObject("ADODB. Recordset")
con.Provider="M icrosoft.Jet.OL EDB.4.0;"
filePath = Server.MapPath( "compute.md b")
con.Open "C:\inetpub\www root\CSF\Databa se\CSFSystem2.m db"
sql = "INSERT INTO [LastTable]([SSection],[SType],[QOne],[QTwo],[QThree],[Q4],[Q5],[Q6],[Q7],[Q8],[Q9],[Q10],[Q11],[Q12],[Q13],[Q14],[Q15],[Q16],[Q17]) values ('" + Ssection + "','" + stype + "','" + qn1 +"','" + qn2 + "','" + qn3 + "','" + qn4 + "','" + qn5 + "','" + qn6 + "','" + qn7 + "','" + qn8 + "','"+ qn9 + "','" + qn10 + "','" + qn11 + "','" + qn12 + "','" + qn13 + "','" + qn14 + "','" + qn15 + "','" + qn16 + "','" + qn17 + "')"
rs.open sql,con
<%
response.Redire ct("SuccessSave .html")
%>
</body>
</html>
Comment