Solved

Get EventLog using VB

Posted on 2001-08-12
3
197 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
Comment Utility
0
 

Expert Comment

by:cpearl_s
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now