>>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 ?