Forum Moderators: open
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/orderform.asp, line 319
I have read the post from April 2004 but it still does not help me solve my problem.
Here is the code at issue:
<%' this is where the information finally gets submitted to the database
DIM Conn1, strConn, SQLstmt, RS1
set Conn1 = server.createobject("adodb.connection")
strConn = "driver={Microsoft Access Driver (*.mdb)};;dbq=Estate.mdb"
Conn1.open strConn
SQLstmt = "INSERT INTO onlineorder (date, firm_name, contact_name, phone_number, email, request, hardcopy, pdfocr, pdfonly, multitiff, singletiff, summationocr, summationonly, webdownload, othertype1, othertype2, instructions )"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & date & "',"
SQLstmt = SQLstmt & "'" & firm_name & "',"
SQLstmt = SQLstmt & "'" & contact_name & "',"
SQLstmt = SQLstmt & "'" & phone_number & "',"
SQLstmt = SQLstmt & "'" & email & "',"
SQLstmt = SQLstmt & "'" & request & "',"
SQLstmt = SQLstmt & "'" & hardcopy & "',"
SQLstmt = SQLstmt & "'" & pdfocr & "',"
SQLstmt = SQLstmt & "'" & pdfonly & "',"
SQLstmt = SQLstmt & "'" & multitiff & "',"
SQLstmt = SQLstmt & "'" & singletiff & "',"
SQLstmt = SQLstmt & "'" & summationocr & "',"
SQLstmt = SQLstmt & "'" & summationonly & "',"
SQLstmt = SQLstmt & "'" & webdownload & "',"
SQLstmt = SQLstmt & "'" & othertype1 & "',"
SQLstmt = SQLstmt & "'" & othertype2 & "',"
SQLstmt = SQLstmt & "'" & instructions & "'"
SQLstmt = SQLstmt & ")"
Set RS1 = Conn1.execute(SQLstmt) this is line 319
Any ideas?
Thanks
breeze76
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & date & "',"
SQLstmt = SQLstmt & "'" & firm_name & "',"
SQLstmt = SQLstmt & "'" & contact_name & "',"
SQLstmt = SQLstmt & "'" & phone_number & "',"
SQLstmt = SQLstmt & "'" & email & "',"
SQLstmt = SQLstmt & "'" & request & "',"
SQLstmt = SQLstmt & "'" & hardcopy & "',"
SQLstmt = SQLstmt & "'" & pdfocr & "',"
SQLstmt = SQLstmt & "'" & pdfonly & "',"
SQLstmt = SQLstmt & "'" & multitiff & "',"
SQLstmt = SQLstmt & "'" & singletiff & "',"
SQLstmt = SQLstmt & "'" & summationocr & "',"
SQLstmt = SQLstmt & "'" & summationonly & "',"
SQLstmt = SQLstmt & "'" & webdownload & "',"
SQLstmt = SQLstmt & "'" & othertype1 & "',"
SQLstmt = SQLstmt & "'" & othertype2 & "',"
SQLstmt = SQLstmt & "'" & instructions & "'"
SQLstmt = SQLstmt & ")"
Response.Write (SQLstmt) <-- check the statement once the values are set
Set RS1 = Conn1.execute(SQLstmt) this is line 319
Will keep you posted
breeze76
You need to change this variable name: request
Request is an intrinsic object that's built into ASP so you can't overload it with your own value. Attempting to do this:
request = Request.Form("somefield")
will throw an error. As would attempting to dump it into a Sql Statement:
SQLstmt = SQLstmt & "'" & request & "',"
Here is the error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''Let's see if this works')'.
/orderform.asp, line 436
Any ideas..
Thanks again
breeze76