What is so different about the following two queries, that the first one works OK and the second one generates the message,
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
Query 1 (works):
Query 2 (error):
Code generating Query 1:
Code generating Query 2:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
Query 1 (works):
Code:
INSERT INTO Users (UserName, Password, FirstName, LastName, Email, Location, TimesLoggedIn, LastLogin, IsAdmin) Values('a', 'a', 'a', 'a', 'a', 'a', '0', 'Never', False)
Query 2 (error):
Code:
INSERT INTO Messages (PostDate, PostTime, From, Subject, ReplyTo, MessageBody) Values('29/06/2002', '1:33:38 PM', 'Brendan', 'submit test', ' 2 ', 'Spectacularrrr')
Code generating Query 1:
Code:
sqlQuery = "INSERT INTO Users (UserName, Password, FirstName, LastName, Email, Location, " &_
"TimesLoggedIn, LastLogin, IsAdmin) Values('" & Request.Form("UserName") & "', '" &_
Request.Form("Password") & "', '" & Request.Form("FirstName") & "', '" & Request.Form("LastName") &_
"', '" & Request.Form("Email") & "', '" & Request.Form("Location") & "', '0', 'Never', " & AMU & ")"
Code generating Query 2:
Code:
sqlQuery = _
"INSERT INTO Messages (PostDate, PostTime, From, Subject, ReplyTo, MessageBody) " &_
"Values(" &_
"'" & Date & "', " &_
"'" & Time & "', " &_
"'" & Request.Form("Name") & "', " &_
"'" & Request.Form("Subject") & "', " &_
"'" & Request.Form("ReplyTo") & "', " &_
"'" & Request.Form("MessageBody") & "')"