waarbs
05-18-2006, 10:57 AM
I think this is one of those simple oversight type problems. At this stage I am simply trying to record the submitted comments into my database - I have not looked at retrieving this info back to a web page yet. I am getting the following error with the asp which deals with my feedback form:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/onlineMScDynamic/HCT/unit 1/session 2/Lo2/u1-s2-lo2.asp, line 187
The ASP code on the rest of the page looks like this:
<a name="comment"></a>
<%
'start asp code
Set ObjDbConnection = Server.CreateObject("ADODB.Connection")
'i want to set up a database connection
ObjDbConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("/onlineMScDynamic/dB/HCT_activityFB.mdb") & ";"
ObjDbConnection.Open
SQLQuery = "INSERT INTO HCT_1-2-2 (studentName, comments) VALUES "
SQLQuery = SQLQuery & "('"
SQLQuery = SQLQuery & Request.QueryString("studentName") & "','"
SQLQuery = SQLQuery & Request.QueryString("comments") & "')"
'response.Write(SQLQuery("studentName"))
'response.Write(SQLQuery("comments"))
ObjDbConnection.Execute(SQLQuery)
'IF ObjDbConnection.Execute(SQLQuery) = true THEN
'response.Write("submitted")
'ELSE
'response.Write("failed")
'END IF
%>
Can anyone spot the problem?
The form can be found at:
http://unthank.nottingham.ac.uk/onlineMScDynamic/HCT/unit%201/session%202/lo2/u1-s2-lo2.htm
Thanks
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/onlineMScDynamic/HCT/unit 1/session 2/Lo2/u1-s2-lo2.asp, line 187
The ASP code on the rest of the page looks like this:
<a name="comment"></a>
<%
'start asp code
Set ObjDbConnection = Server.CreateObject("ADODB.Connection")
'i want to set up a database connection
ObjDbConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("/onlineMScDynamic/dB/HCT_activityFB.mdb") & ";"
ObjDbConnection.Open
SQLQuery = "INSERT INTO HCT_1-2-2 (studentName, comments) VALUES "
SQLQuery = SQLQuery & "('"
SQLQuery = SQLQuery & Request.QueryString("studentName") & "','"
SQLQuery = SQLQuery & Request.QueryString("comments") & "')"
'response.Write(SQLQuery("studentName"))
'response.Write(SQLQuery("comments"))
ObjDbConnection.Execute(SQLQuery)
'IF ObjDbConnection.Execute(SQLQuery) = true THEN
'response.Write("submitted")
'ELSE
'response.Write("failed")
'END IF
%>
Can anyone spot the problem?
The form can be found at:
http://unthank.nottingham.ac.uk/onlineMScDynamic/HCT/unit%201/session%202/lo2/u1-s2-lo2.htm
Thanks