Error in accessing a particular event log through SWbemLocator
- From: Visceral <Visceral@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Aug 2009 11:20:09 -0700
I am using WMI (SWbemLocator) to access the event logs in a server. All the
logs in a specified duration are being retrieved through an appropriate WQL
query and their Message populated in separate notepads.
This works fine, but one particular log is repeatedly causing the code to
break. It throws VB run-time error 13. Every single time, the moment this log
is reached, the error occurs.
For Each objLog In colSWbemObjectSet
MsgBox (objLog.TimeWritten)
MsgBox (objLog.Message)
Next
Now if I put a comment (') for the 2nd Msgbox, it works fine while scanning
this particular log.
It is a very simple log. It has some simple strings, some " characters and a
XML line. There is no other special character.
I was wondering if this is causing any VB related problem. I put the exact
log contents in a notepad in my local desktop and wrote a VBScript code to do
the same things as the VBScript in the WMI code does. There was no problem,
there should not be any VBScript related problem here. What might be going
wrong?
.
- Prev by Date: RE: Win32_PerfFormattedData_NETFramework_NETCLRMemory
- Next by Date: WMI SDK for Windows Server 2003
- Previous by thread: RE: WMI events in windows server SP2 2003 x64
- Next by thread: WMI SDK for Windows Server 2003
- Index(es):
Relevant Pages
|