Code snippet from old archives. It shows how to import Windows event log entries to database. Important is to setup database and table accordingly, so it contains apropriate columns.
Set objConn = CreateObject("ADODB.Connection") Set objRS = CreateObject("ADODB.Recordset") objConn.Open "DSN=EventLogs;" objRS.CursorLocation = 3 objRS.Open "SELECT * FROM tblEventLog" , objConn, 3, 3 strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colRetrievedEvents = objWMIService.ExecQuery _ ("Select Category, CategoryString, ComputerName, Data, EventCode, _ EventIdentifier, EventType, LogFile, Message, RecordNumber, SourceName, _ TimeGenerated, TimeWritten, Type, User from Win32_NTLogEvent") For Each objEvent in colRetrievedEvents objRS.AddNew objRS("el_Category") = objEvent.Category objRS("el_CategoryString") = objEvent.CategoryString objRS("el_ComputerName") = objEvent.ComputerName objRS("el_Data") = objEvent.Data objRS("el_EventCode") = objEvent.EventCode objRS("el_EventIdentifier") = objEvent.EventIdentifier objRS("el_EventType") = objEvent.EventType objRS("el_LogFile") = objEvent.LogFile objRS("el_Message") = objEvent.Message objRS("el_RecordNumber") = objEvent.RecordNumber objRS("el_SourceName") = objEvent.SourceName objRS("el_TimeGenerated") = objEvent.TimeGenerated objRS("el_TimeWritten") = objEvent.TimeWritten objRS("el_Type") = objEvent.Type objRS("el_User") = objEvent.User objRS.Update Next objRS.Close objConn.Close