I've got an access table with the following schema...
ErrorLogID - AutoNumber
ErrorMessage - Memo
TimeStamp - Date/Time
Location - Text
I'm trying to run an insert statement against this table with the following VBA code...
Public Sub Error_Report(Msg As String, location As String)
Dim sql As String
sql = "INSERT INTO tbErrorLog (ErrorMessage, TimeStamp, Location) VALUES ('" + Common.PrepSqlString(Msg) + "', '" + CStr(Now) + "', '" + Common.PrepSqlString(location) + "')"
This code produces the following sql for the insert statement.
INSERT INTO tbErrorLog (ErrorMessage, TimeStamp, Location) VALUES ('Testing', '2/16/2011 1:00:34 PM', 'Test')
I'm getting an error message saying there is incorrect syntax on the insert statement. I know that my Common.ExecuteNonQuery method is working correctly. What is wrong with my sql syntax for this insert statement.