Login | |
|
 |
RE: EventLog query: source null - 8/18/2007 8:14:53 AM
|
|
 |
|
| |
CondoPC
Posts: 118
Score: 0
Joined: 7/23/2007
Status: offline
|
>>2. Is there any way to check if the colLoggedEvents if it's null? maybe something like: If IsNull(colLoggedEvents) Then MsgBox "No items found" End If I posted a similar issue last night when using a filtering query with QueryExec. As for your #2, you may want to try and qualify the results by using a count. if colLoggedEvents.count < 1 then wscript.echo "no matching events found" else wscript.echo "matches found" For <...more code here ...> End If
|
|
| |
|
|
|
 |
RE: EventLog query: source null - 8/18/2007 9:10:12 AM
|
|
 |
|
| |
sheepz
Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
|
dm - thanks for verifying, i haven't checked this on another pc. since you guys didn't see anything wrong i'll try on another PC Condo - i saw your post right after i posted mine. =) thx for the colLoggedEvents.count, i didn't know the properties of collections. is .count the only one? trying to see if theres any other properties. found this site... seems theres two properties to collectsion .count and .item, and one method .Refresh http://www.devguru.com/technologies/ado/quickref/parameter_propertiescollection.html
< Message edited by sheepz -- 8/18/2007 9:16:38 AM >
|
|
| |
|
|
|
 |
RE: EventLog query: source null - 8/18/2007 9:22:01 AM
|
|
 |
|
| |
sheepz
Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
|
i used this: if colLoggedEvents.count < 1 then wscript.echo "no matching events found" else wscript.echo "matches found" End If And tried: If colLoggedEvents.count = 0 Then wscript.echo "no matching events found" else wscript.echo "matches found" End If and both still get an Error: Generic failure Source: SWbemObjectSet
< Message edited by sheepz -- 8/18/2007 9:48:44 AM >
|
|
| |
|
|
|
 |
RE: EventLog query: source null - 8/18/2007 10:00:42 AM
|
|
 |
|
| |
sheepz
Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
|
sorry about that DM and condo, i used: if colLoggedEvents.count < 1 then wscript.echo "no matching events found" else wscript.echo "matches found" End If and i get that generic failure on one desktop... i tried the same script on another desktop and it works fine... seems apparent that something is wrong with the other desktop... i was getting confused why System Logfile would work and Application wouldn't... thanks helping
|
|
| |
|
|
|
|
|