Can anyone spot the obvious that I am missing?
I am trying to append data into an Access database and I keep getting the error
message 'Syntax error in INSERT INTO statement'
I have worked through the SQL, one item at a time removing each and trying to
find the offending item. However, I keep getting the error message. Yet, when I
copy the SQL straight over to Acces and paste it into a query, it works.
I am assuming then, that the Jet engine is objecting to something, though for
the life of me, after a hard day's work, I cannot see what.
The full SQL is
INSERT INTO tblCADreSchedule(autoCadFk, oldDate, oldTime, newDate, newTime,
fldComments, user,datWhen) VALUES (1323,#8-Apr-2005#,#15:00#,
#12-Apr-2005#,#18:00#,'were ','robinsop',#12-Apr-2005#)
autoCadFk is a number field
oldDate, oldTime, newDate, newTime, datWhen are date/time fields
fldComments is a memo field
user is a text field
My ASP code is :
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\Projects.mdb;"
Set objConn = server.CreateObject("ADODB.Connection")
objConn.open strConnect
strSQL = "INSERT INTO tblCADreSchedule(autoCadFk, " & _
"oldDate, " & _
"oldTime, " & _
"newDate, " & _
"newTime, " & _
"fldComments, "
& _
"user, " & _
"datWhen)" & _
" VALUES (" & iCadReq & ",#" &
_
FormatLoadDate(datReqDate,3) & "#,#" & _
FormatDateTime(datReqTime,4) & "#, #" & _
Request.Form("RequestReplyDate") & "#,#" & _
Request.form("cboTime") & "#,'" & _
Request.Form("txtComments") & "','" & _
strUser & "',#"
& _ datToday & "#)"
objConn.Execute (strSQL)
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/