Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect Event Viewer Keywords null value
Message
From
10/01/2017 10:57:01
 
 
To
10/01/2017 10:40:16
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01646401
Message ID:
01646462
Views:
18
>>So if you inspect the log using the EventViewer what is the Keywords property for an event which comes up with null in code ?
>>Did you try running the equivalent of my code ?
>
>In there, Keywords shows Classic. However, in my table, I cannot collect it. I think this is related to the fact the Keywords is recognized as null. So, the code cannot determine the KeywordsDisplayNames property.
>
>Your code is exactly like mine:
>
>
>' If we need the Keywords
>If lKeyword Then
>   'loInsertRow.ParameterAdd("Keyword", loEventRecord.Keywords)
>End If
>
>' If we need the Keywords display name
>If lKeywordDisplayName Then
>
>   ' This one cannot be detected with IF NOT loEventLogRecord.KeywordsDisplayNames IS NOTHING
>   Try
>
>      ' Reset the values
>      lcFinal = ""
>
>      ' For each keyword
>      For Each lcString In loEventLogRecord.KeywordsDisplayNames
>
>         ' If we have a string
>         If lcFinal.Length > 0 Then
>            lcFinal = lcFinal + ", "
>         End If
>
>         lcFinal = lcFinal + lcString
>      Next
>
>      loInsertRow.ParameterAdd("KeywordDisplayName", lcFinal)
>      Catch loException As Exception
>   End Try
>
>End If
>
>
>See attached.

Hmm. As far as I'm aware 'Classic is the DisplayName for the 0x80000000000000 KeyWords value - which indicates that it is NOT null. Check again in the Event Viewer but look at the Detail/Xml View. You could also look at the Xml in code with loEventLogRecord.ToXml().

When you run the above code what is the Exception ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform