Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect Event Viewer Keywords null value
Message
De
10/01/2017 10:02:47
 
 
À
10/01/2017 09:24:54
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01646401
Message ID:
01646453
Vues:
20
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform