This is my crash reporter tool, version 1.0. It has already gone through a lot of changes since the beta version, and I still have features and stuff I wish to add, but I think it is time to start letting others use it. For download links, see the bottom of this page.
What is this Crash Reporter?
If you have worked with users for a while you have probably found out that they are not always the most reliable source of information for details on error reporting.
If you (the developer) are sitting in the same building, they might just swing by, and have you come take a look at their monitor. But what if they are in another building, or another city? Well a few options could occur:
- They never report the error to you and just continue to try to use the program, but eventually get tired of getting the same error and blame you, even though they actually did not do anything to give you a chance to correct the error.
- They send you an email or phone you up, and this might be an example of the dialogue to take place:
- User/Client: “Hey Developer, we had an error”.
- Developer : “Okay, can you tell me what the error number was?”
- User/Client: “I think it started with a 6, or maybe a 7″
- Developer: “Hmm. ok, what were you doing at the time?”
- User/Client: “I was working in the tool”
- Developer “Yes, but which screen or form were you using?”
- User/Client: “The one with the big textbox for details!”
- Developer: “Okay, what did you do right before the error occurred?”
- User/Client: “I was browsing the internet”
- Developer: “I meant in the application”
- User/Client: “Oh, I think I was updating a customer record”
- (rare) They take a screenshot and write a detailed error report saying what they were doing, and include relevant details about the error number, error description and what else they might have been doing just before.
Now imagine how nice it would be if every user did option 3. But wait, what if we could help turn regular users into those super users? The good news is that, now you can! With this free piece of software you can now present a pretty looking error form and AUTOMATICALLY generate detailed and useful error reports including screenshots of all your open forms and the application.
Form example
This is the form as presented to the user. Of course you can modify it to look as you please.
Example of error report:
Expand|Select|Wrap|Line Numbers
- Error ID:F9AE94266E3943DBB1D664959A33868F
- ==== Error Message as presented to user ====
- Error 91 has occurred in procedure [cmdCauseError_Click] in module [TSC_ErrRep_frm_Test_ErrorReportTool]
- Object variable or With block variable not set
- This error was raised in order to test the Error report functionality
- ==== Error Number ====
- 91
- ==== Error Line (0 if N/A) ====
- ==== Error Description ====
- Object variable or With block variable not set
- ==== Error in Module ====
- TSC_ErrRep_frm_Test_ErrorReportTool
- ==== Error in Procedure ====
- cmdCauseError_Click
- ==== Session Information ====
- ==== Application Information ====
- Name : TSC_ErrorReporter – BETA.mdb
- Path : C:\Users\Documents\Applications\ErrorReport\TSC_ErrorReporter – BETA.mdb
- Active Form : TSC_ErrRep_frm_Test_ErrorReportTool
- Active Control : cmdCauseError
- Parent Form(if any) : TSC_ErrRep_frm_Test_ErrorReportTool
- Active Datasheet : N/A
- Active Report : N/A
- Open forms : TSC_ErrRep_frm_Test_ErrorReportTool
- ==== Access Info ====
- Version : 14.0
- Build : 6024
- Fileformat : 10
- DB Version : 4.0
- ==== Time of Error ====
- 15-03-2013 15:01:55
- ==== Windows User Name ====
- aec
- ==== Active Form ====
- TSC_ErrRep_frm_Test_ErrorReportTool
- ==== Active Control ====
- cmdCauseError
- ==== Active Control Parent Form ====
- TSC_ErrRep_frm_Test_ErrorReportTool
- ==== Active Data Sheet ====
- N/A
- ==== Active Report ====
- N/A
- ==== All Open Forms ====
- TSC_ErrRep_frm_Test
- ==== Application Version ====
- 1.0
- ==== TheSmileyCoders Crash Reporter Version Info ====
- 1.0
- ==== Application Version ====
- 1.0
- ==== Minutes application has been running ====
- 157
- ==== Hours since last Windows reboot ====
- 7
All error information is also stored in a table. This table can be local or networked(If networked switch dbOpenTable to dbOpenDynaset). The error report is of course error resistant so even if no connection is available to the network, the reporter will continue, and store all the information into a text-based log file, which can be emailed along with the screenshots to your email!
Email Options
TheSmileyCoders Crash Reporter is setup to use either Outlook or CDO (with Gmail). To use the built in CDO you need to have a Gmail account setup that you can use for this purpose, however if you are more experienced in CDO, you should be able to setup the Crash Reporter to use other email accounts. Screenshots and error log are automatically attached.
That sounds expensive!
Nope, I have chosen to provide this tool absolutely free of charge, under the Creative Commons 3.0 license. For more details see http://creativecommons.org/licenses/by/3.0/. This means that you may use, alter, copy, redistribute and include this code in your application, provided that you include the attribution details specified in each module.
Why is that? Well, maybe I could sell this tool for some nice money, but the fact is that I want to give something back to the Access community which has helped me learn and evolve to the point where writing such an application is possible, and also because I would rather see my hard work being put to good use, and because I am not big on marketing. But hey, when that first error report ticks into your mailbox, if you find my Crash Reporter useful, why not drop a thank you comment on my blog? Those comments are the real return-value for me.
Setup and Use
For setup information, you can watch this YouTube video, and/or read on:
Before you start using the Crash Reporter, you need to modify the following settings found in the TSC_ErrRep_Main module. I have highlighted the areas that need to be set if you use Outlook as your email client.
Expand|Select|Wrap|Line Numbers
- ‘***************************************************************************************
- ‘ – Err reporter settings
- ‘***************************************************************************************
- ‘Place YOUR email here, the email which the reports should be sent to
- Public Const gReportErrorToEmail As String = “YourEmail@SomeWhere.com”
- ‘Place the name of your application in here. It will be used in various message boxes and captions
- Public Const gAppName As String = “TheSmileyCoders Report Tool”
- ‘Place the name of your company, or your own name here
- Public Const gDeveloperName As String = “TheSmileyCoder”
- ‘Choose whether to use Outlook or CDO for mail
- Public Const gUseOutlook As Boolean = True
- ‘Place details on the Gmail account for which to use CDO to send error message
- Public Const gSendUserName As String = “”
- Public Const gSendPassword As String = “”
- ‘Set whether or not to take a screenshot, and whether to include it per default
- Public Const gTakeScreenshot As Boolean = True
- Public Const gDefaultSubmitScreenshot As Boolean = True
- ‘Whether or not to dim the background as the submit error form is opened
- Public Const gDimBackground As Boolean = True ‘Default is true
- ‘Version of Error report tool in use
- Public Const gErrorReportToolVersion As String = “1.0″
- If you want to use CDO instead, so you don’t have to rely on the user having outlook installed, you can modify the following settings:
- ‘Choose whether to use Outlook or CDO for mail
- Public Const gUseOutlook As Boolean = False
- ‘Place details on the gmail account for which to use CDO to send error msg
- Public Const gSendUserName As String = “YourExtraEmail@gmail.com”
- Public Const gSendPassword As String = “YourPassword“
Now with the settings in place, you need to import all the objects from the sample database, into your application. The only object that is not required is the test form. Once imported, start by checking that it compiles fine within your environment, by selecting Debug->Compile in the VBA editor. Then you need to look at your error handling procedures, and modify them to use the error report tool. Now if you already have error handling code, it might look something like this:
Expand|Select|Wrap|Line Numbers
- Private Sub YourCode()
- On Error goto ErrHandler
- 'Some code
- ExitSub:
- Exit Sub
- ErrHandler:
- Msgbox Err.Number & " - " & err.Description
- Resume ExitSub
- End Sub
Expand|Select|Wrap|Line Numbers
- TSCs_ReportUnexpectedError "Name of your procedure", "Name of module or form", "Custom info"
Summary
In this post I presented my new Crash Reporter. With this you can easily get much more detailed and useful information when a bug/error occurs in your software, and users get presented with a much nicer looking custom form, instead of the plain old windows message box.
The download comes with a test form, so you can start experimenting with the Crash Reporter today!
Download
TheSmileyCoders Crash Reporter Version 1.0
Known Issues
If you are using tabbed forms in your access application the Crash Reporter will sometimes only take a screenshot of the topmost (the visible/active) form.
I have heard reports that it does not currently work on windows 8, but without access to windows 8 myself I can't test it.