I am trying to cretae a tools that accesses the 200 2003 eventlogs from WMI and keep running into this error I know it has to do with my connction to the msaccess db yet the string is corect and permissions are wide open any ideas?
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objRecordset.CursorLocation = adUseClient
objRecordset.Open "SELECT * FROM EVENTLOG WHERE RECID = RECID) (objConnection) "
Set colNTLogEvent = GetObject("winmgmts:").ExecQuery _
("Select * from Win32_NTLogEvent")
For Each wmiRecord In wmiResultSet
objRecordset("EDATE") = dtDate
objRecordset("ETIME") = dtTime
objRecordset("sourceName") = wmiRecord.SourceName
objRecordset("eventcode") = wmiRecord.EventCode
objRecordset("MESSAGE") = wmiRecord.Message
Originally posted by MrWizard
Don't know if this is your only issue... but try...
objRecordset.Open "SELECT * FROM EVENTLOG WHERE RECID =" & RECID, objConnection, adOpenStatic, adLockOptimistic
assuming that RecID is a numeric value rather than a string.
Itried it still didn't work so I went a different way and I get this even though everything is correct even the database.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''Windows saved user VERIZON-WMIDEV\Administrator registry while an application or service was still using the registry during log off. The memory used by the user's registry has not been freed. The registry will be unloaded when it is no longer in use. '.
The forum would not let me post more information about this problem
I am capturing eventlogs to an access 2002 db it completes its purpose and errors out with the error I can look in the database and my information is there yet I still recieve the error.