chongo 2002
Jun 10th, 2000, 04:17 AM
Does anyone see a syntax error in the following code? I keep getting the error.
ERROR--------------\/
Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. /air/newforum/addnew.asp, line 66
CODE------------------\/
Application.Lock
sSQL = "INSERT INTO Message ( `From`, Email, Subject, Body, When, MsgLevel, PrevRef, ThreadPos, GroupName, Host ) " _
& "VALUES ('" & strFrom & "', '" & strEmail & "', '" & strSubject _
& "', '" & strBody &"', '" & CStr(Now()) & "', " & intNewMsgLevel _
& ", " & lngPrevRef & ", " & intNewThreadPos & ", '" & strGroup & "', '" &strHost &"');"
'Response.Write sSQL
db.Execute(sSQL) ***************line 66 ****************
ThreadIDQuery = "SELECT MAX(ID) AS LastMessage FROM Message"
Set MaxID = db.Execute(ThreadIDQuery)
LastMessage = MaxID("LastMessage")
If intThreadId = 0 Then
intThreadID = cint(LastMessage)
End If
IDUpdate = "UPDATE Message SET Message.ThreadID='" & intThreadID & "' Where ID="&LastMessage
db.Execute(IDUpdate)
Application.Unlock
ERROR--------------\/
Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. /air/newforum/addnew.asp, line 66
CODE------------------\/
Application.Lock
sSQL = "INSERT INTO Message ( `From`, Email, Subject, Body, When, MsgLevel, PrevRef, ThreadPos, GroupName, Host ) " _
& "VALUES ('" & strFrom & "', '" & strEmail & "', '" & strSubject _
& "', '" & strBody &"', '" & CStr(Now()) & "', " & intNewMsgLevel _
& ", " & lngPrevRef & ", " & intNewThreadPos & ", '" & strGroup & "', '" &strHost &"');"
'Response.Write sSQL
db.Execute(sSQL) ***************line 66 ****************
ThreadIDQuery = "SELECT MAX(ID) AS LastMessage FROM Message"
Set MaxID = db.Execute(ThreadIDQuery)
LastMessage = MaxID("LastMessage")
If intThreadId = 0 Then
intThreadID = cint(LastMessage)
End If
IDUpdate = "UPDATE Message SET Message.ThreadID='" & intThreadID & "' Where ID="&LastMessage
db.Execute(IDUpdate)
Application.Unlock