Solved

Get EventLog using VB

Posted on 2001-08-12
3
201 Views
Last Modified: 2012-05-04
Does anyone know hot to get the record in the event log of windows NT or 2000? I need to make an application that read the event log and insert it into database.
I searched the MSDN but I only get the sample using Visual C++.
Any help or direction would be great appreciated.
0
Comment
Question by:falconew
3 Comments
 
LVL 6

Accepted Solution

by:
xSinbad earned 300 total points
ID: 6378753
0
 

Expert Comment

by:cpearl_s
ID: 6378967
Hope this will guide u in rest of u'r process.
Just take a backup of the application event log, then
try write database programm that format that message and store in a db as specified in message format.
Iam also trying that , if i get that i let u know, hope u to the same.


Private Declare Function BackupEventLog Lib "advapi32.dll" Alias "BackupEventLogA" (ByVal hEventLog As Long, ByVal lpBackupFileName As String) As Long
Private Declare Function OpenEventLog Lib "advapi32.dll" Alias "OpenEventLogA" (ByVal lpUNCServerName As String, ByVal lpSourceName As String) As Long

Private Sub cmdBkUpLog_Click()
Dim lng As Long
Dim str As String

lng = BackupEventLog(OpenEventLog("ServerName", "Application"), "C:\Eve.txt")

End Sub


regards
cpearl
0
 
LVL 1

Author Comment

by:falconew
ID: 6379077
Thanks xSinbad,
It is I was looking for.
For my great thanks I increase the point to be 350.

Thanks also to cpearl_s, actually it is the last solution I've ever think if I can't find the solution from xSinbad.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question