This article offers a solution to track IIS 500 errors and store them in a database.
The only things that you will have to do is to implement an own page evoked as error page in case of HTTP Errors and the database objects.
But please pay attention regarding the note for error handling of "normal" ASP errors.
"Note that Server.GetLastError and the ASPError object are *only* available in the custom 500 error handler. In your normal ASP pages, they will not work as illustrated above. For more information, see the ASPError Object and Server.GetLastError topics in MSDN's Online Library."