SteveH
05-04-2010, 05:22 PM
Hello
I am getting the following error which trying to use an INSERT SQL statement.
The error is this:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '''message'.
/ASP_Operations.asp, line 31
line 31 refers to conn.Execute(SQL) in the following code:
<%
Dim conn,rs,SQL,myMail,name,staffID,email,subject,campus,message
'Open MS Access database, store form field values
set conn=Server.CreateObject("ADODB.Connection")
conn.open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("my_database.mdb")& ";"
name = Request.Form("name")
staffID = Request.Form("staffID")
email = Request.Form("email")
subject = Request.Form("subject")
campus = Request.Form("campus")
message = Request.Form("message")
SQL="INSERT INTO users (name, staffID, email, subject, campus, message) VALUES ('" & _
name & "', '" & staffID & "','" & email & "', '" & subject & "', '" & campus & "'message"')"
conn.Execute(SQL)
I have declared conn as a variable, so I am unsure why the server is pointing to that as an error.
Many thanks.
Steve
I am getting the following error which trying to use an INSERT SQL statement.
The error is this:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '''message'.
/ASP_Operations.asp, line 31
line 31 refers to conn.Execute(SQL) in the following code:
<%
Dim conn,rs,SQL,myMail,name,staffID,email,subject,campus,message
'Open MS Access database, store form field values
set conn=Server.CreateObject("ADODB.Connection")
conn.open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("my_database.mdb")& ";"
name = Request.Form("name")
staffID = Request.Form("staffID")
email = Request.Form("email")
subject = Request.Form("subject")
campus = Request.Form("campus")
message = Request.Form("message")
SQL="INSERT INTO users (name, staffID, email, subject, campus, message) VALUES ('" & _
name & "', '" & staffID & "','" & email & "', '" & subject & "', '" & campus & "'message"')"
conn.Execute(SQL)
I have declared conn as a variable, so I am unsure why the server is pointing to that as an error.
Many thanks.
Steve