Stang70Fastback
Registered User.
- Local time
- Today, 17:45
- Joined
- Dec 24, 2012
- Messages
- 132
Hey guys. I'm new to SQL, and I can't seem to resolve this problem (and neither could my SQL friend.) I recently converted my back end to SQL, and since then I've been trying to track down things that broke, and fix them.
I'm having trouble getting timestamps to communicate properly between Access and SQL. I have a field set to a 'datetime' data type in SQL, but no matter how I structure the timestamp on the Access side, it does not seem to like the data.
The code below worked fine when the table was in Access:
But now that the table in in SQL and using an ODBC connection, I get the following error:
In SQL, I have the column for the timestamp set as a datetime field. Any help would be appreciated!
I'm having trouble getting timestamps to communicate properly between Access and SQL. I have a field set to a 'datetime' data type in SQL, but no matter how I structure the timestamp on the Access side, it does not seem to like the data.
The code below worked fine when the table was in Access:
Code:
DoCmd.RunSQL "INSERT INTO ERRORLOG (ErrNum, ErrDesc, ErrProc, ErrUser, ErrTimestamp) " & _
"VALUES (" & TheNum & ", '" & TheDesc & "', '" & TheProc & "', '" & fOSUserName() & "', #" & Now() & "#);"
But now that the table in in SQL and using an ODBC connection, I get the following error:
Run-time error '3075':
Syntax error (missing operator) in query expression "The command or action 'Quit' isn't available now.', 'MAINWINDOW - Form_Close', 'jdoe', #1/22/2015 11:29:42 AM#);'.
In SQL, I have the column for the timestamp set as a datetime field. Any help would be appreciated!
Last edited: