When trying to insert a record into an Access database, I get the following error message:
strSQL:INSERT INTO shiur (username,slanguage,shiurFor,shiurType,sTitle,mTitle,mFirst,mLast,shiurFreq,date,time,sduration,venue,city,contact,comments,add_date,status) VALUES('smith',2,1,3,'Something interesting',4,'PJ','Smith',5,'2/26/26','1230',2,'home',1,'Mr Jones','Will begin promptly','9/26/2004 4:04:18 PM',3)
Error:-2147217900|[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
I've double checked that each ACCESS field is correctly labelled as a "TEXT" or "NUMBER" field. I have also confirmed that only those fields to be entered as TEXT have the necessary single-quotation marks.
Where is the error?? Thanks in advance for your help.
My code is:
strSQL = "INSERT INTO shiur (username,slanguage,shiurFor,shiurType,sTitle,mTitle,mFirst,mLast,shiurFreq,date,time,sduration,venue,city,contact,comments,add_date,status) VALUES(" _
& "'" & Trim(Request.Cookies(consts_CollectionName_User)("CurrentUser")) & "'," _
& Request.Form("slanguage") & "," _
& Request.Form("shiurFor") & "," _
& Request.Form("shiurType") & ",'" _
& Trim(Request.Form("sTitle")) & "'," _
& Request.Form("mTitle") & ",'" _
& Trim(Request.Form("mFirst")) & "','" _
& Trim(Request.Form("mLast")) & "'," _
& Request.Form("shiurFreq") & ",'" _
& wholeDate & "','" _
& Trim(Request.Form("stime")) & "'," _
& Request.Form("sDuration") & ",'" _
& Trim(Request.Form("venue")) & "'," _
& Request.Form("vcity") & ",'" _
& Trim(Request.Form("contact")) & "','" _
& Replace(Trim(Request.Form("comments")),"'","`") & "','" _
& Now() & "'," _
& constSF_Status_Active _
& ")"
Call DAL_ExecuteSQL(strSQL)
strSQL:INSERT INTO shiur (username,slanguage,shiurFor,shiurType,sTitle,mTitle,mFirst,mLast,shiurFreq,date,time,sduration,venue,city,contact,comments,add_date,status) VALUES('smith',2,1,3,'Something interesting',4,'PJ','Smith',5,'2/26/26','1230',2,'home',1,'Mr Jones','Will begin promptly','9/26/2004 4:04:18 PM',3)
Error:-2147217900|[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
I've double checked that each ACCESS field is correctly labelled as a "TEXT" or "NUMBER" field. I have also confirmed that only those fields to be entered as TEXT have the necessary single-quotation marks.
Where is the error?? Thanks in advance for your help.
My code is:
strSQL = "INSERT INTO shiur (username,slanguage,shiurFor,shiurType,sTitle,mTitle,mFirst,mLast,shiurFreq,date,time,sduration,venue,city,contact,comments,add_date,status) VALUES(" _
& "'" & Trim(Request.Cookies(consts_CollectionName_User)("CurrentUser")) & "'," _
& Request.Form("slanguage") & "," _
& Request.Form("shiurFor") & "," _
& Request.Form("shiurType") & ",'" _
& Trim(Request.Form("sTitle")) & "'," _
& Request.Form("mTitle") & ",'" _
& Trim(Request.Form("mFirst")) & "','" _
& Trim(Request.Form("mLast")) & "'," _
& Request.Form("shiurFreq") & ",'" _
& wholeDate & "','" _
& Trim(Request.Form("stime")) & "'," _
& Request.Form("sDuration") & ",'" _
& Trim(Request.Form("venue")) & "'," _
& Request.Form("vcity") & ",'" _
& Trim(Request.Form("contact")) & "','" _
& Replace(Trim(Request.Form("comments")),"'","`") & "','" _
& Now() & "'," _
& constSF_Status_Active _
& ")"
Call DAL_ExecuteSQL(strSQL)