TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Syntax error in INSERT INTO statement.

Page: 1 Reply
Feb 15th 2002#31088 Report
Member since: Jun 8th 2001
Posts: 451
I'm getting this error..

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

/v4/gy/adddb.asp, line 29


with this code..

@ Language=VBScript
Option Explicit



dim MyConn, sql, strdate, strlarg_img, strsmall_img, strauthor, stremail, strcat
%>




strdate = Request.Form("date")
strlarg_img = Request.Form("larg_img")
strsmall_img = Request.Form("small_img")
strauthor = Request.Form("author")
stremail = Request.Form("email")
strcat = Request.Form("cat")

'build up first INSERT
sql = "INSERT INTO gallery (date,larg_img,small_img,author,email,cat) values("
sql = sql & "'" & strdate & "',"
sql = sql & "'" & strlarg_img & "',"
sql = sql & "'" & strsmall_img & "',"
sql = sql & "'" & strauthor & "',"
sql = sql & "'" & stremail & "',"
sql = sql & "'" & strcat & "')"

'execute first statement
myConn.execute sql


'clean up
set myConn = nothing


I tried to add [] around gallery but I still came up with the same error.
Reply with Quote Reply
Feb 21st 2002#32166 Report
Member since: Feb 21st 2002
Posts: 1
I don't see anything obvious. If you happen to have a single quote as part of one of the request strings, it would cause a syntax error.

Best bet is to output the SQL string after it's been pieced together and see if the final string is what you expected.
Reply with Quote Reply
Feb 21st 2002#32174 Report
Member since: Jun 8th 2001
Posts: 451
I had to change "date" to "gdate" in the db. I guess "date" is a reserved statement.
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum