Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect Event Viewer Keywords null value
Message
From
10/01/2017 10:02:47
 
 
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:
01646453
Views:
19
>It will convert a null value to a 0 if that occurs but the real fix is to use the try/catch block to ignore log entries which cannot be resolved. There can be several reasons why that can happen. See:
>https://support.microsoft.com/en-us/kb/166902
>I guess the EventReader is a bit flaky when that happens - the EventLogRecord is created but some properties cannot be populated because the data can't be found.
>AFAIKS ignoring these (or handling them differently) is the only solution.

Like I said, Keywords is a different beast.

See this code:
' This can be null
lnKeyword = If(loEventLogRecord.Keywords, 0)

' If we need the Keywords
If lKeyword Then
   loInsertRow.ParameterAdd("Keyword", lnKeyword)
End If
And, I still end up with a null.

See image attached.

Those are the most recent records.

Before, I had the insert line commented. So, it was placing 0. Now, that I uncommented the line, and added the if() approach, it still places null in the table field.

Basically, the if() cannot detect the null value. It thinks there is something in that loEventLogRecord.Keywords property.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform