WMI - Error in accessing a particular event log th
This is not really a QTP query but WMI query. I haven't found an active WMI forum so far and am hence posting it here, in the hope that someone might be able to help.
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
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?
Re: WMI - Error in accessing a particular event log th
I could track that this issue is occuring because objLog.Message is NULL for such logs.
what really beats me is why the contents of these logs are being returned as NULL. I have tracked all these error-causing logs and each one of them has contents and are of the type - ( .... ) in Source ( .... ) cannot be found. The local computer may not have the necessary registry information....
I had thought that the Message property of any instance of Win32_NTLogEvent will always give the exact thing as what is seen by double clicking in the eventvwr. It doesn't seem to be the case.
PS - Some 1 must be interested in WMI here!