Write/Read to Windows Event Log [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this questionIs there an easy way to write to and read from the windows event log in VBA?
Yes, using the standard API calls. See HOWTO: Write to the Windows NT Event Log from Visual Basic This is fairly old but should get you started.
Note, however, that this code uses a default source. (Run the event log to see what I mean by source.) I haven't run tihs code in Access so I don't know what the default source is for Access. In VB6 thuogh it was something generic with VB 6 runtime or some such. If you visit the thread ReportEvent and MessageDLL problem Options it states you need to run an install program with admin privileges to add your app name and path to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\ So this could get even more complex when it comes to getting a distinguishable source in the event log.
精彩评论