VBA to add record into SQL 2005 not working

vapid2323

Scion
Local time
Today, 12:29
Joined
Jul 22, 2008
Messages
217
Hye guys

Any idea why this bit of code might not import into a table? I don’t get any errors and all the values are correct, it just simply will not add the data into the table.

Code:
ErrHandler:
Code:
[FONT=Arial]   If Err.Number <> 0 Then[/FONT]
[FONT=Arial]       CurrentDb.Execute "INSERT INTO [tblErrorLog] SELECT """ & wbk.Name & """ AS WorkbookName,#" & Now() & "# AS ErrorDate,""" & Err.Description & """ AS ErrorDesc;", [dbSeeChanges][/FONT]
[FONT=Arial]       Err.Clear: On Error GoTo -1: On Error GoTo 0[/FONT]
[FONT=Arial]   End If[/FONT]
[FONT=Arial]   wbk.Close 0[/FONT]
[FONT=Arial]   Set wks = Nothing[/FONT]
[FONT=Arial]   Set wbk = Nothing[/FONT]

WorkbookName - nvarchar(255)
ErrorDate - datetime
ErrorDesc - nvarchar(255)
WFB-Last-Update - datetime ((getdate()))
ErrID - uniqueidentifier
 

Users who are viewing this thread

Back
Top Bottom