UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Crash Reporter, Any Version    
 
   
TheSmileyCoder
post Mar 19 2013, 03:35 PM
Post#1


UtterAccess VIP
Posts: 1,506
Joined: 19-January 12
From: Denmark, Copenhagen


Introduction
ome of you may have heard me talk about this pet project of mine on LinkedIn or elsewhere, and now I am finally ready to share it. 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:
Attached File  ErrorReporterFormScreenshot.png ( 54.81K )Number of downloads: 101


Example of error report:
What else can it do?
All error information is also stored in a table. This table can be local or networked. 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.
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 some of the settings found in the TSC_ErrRep_Main module, namely the gReportErrorToEmail, gAppName and gDeveloperName.
CODE
‘*******************************************************************************
********
‘ – 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:
CODE
‘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“

I would suggest not using your own gmail, but creating a Gmail account specifically for this purpose.

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:
CODE
Private Sub YourCode()
On Error goto ErrHandler

'Some code

ExitSub:
  Exit Sub

ErrHandler:
  Msgbox Err.Number & " - " & err.Description
  Resume ExitSub

End Sub

Now instead of that plain old message box saying there has been an error, you can now use the Error reporter. Simply replace the MsgBox line with:
CODE
TSCs_ReportUnexpectedError "Name of your procedure", "Name of module or form", "Custom info"

and the tool will handle the rest, including taking screenshots, preparing the error report, and opening the error report form.
Summary
In this article 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!
TheSmileyCoders Crash Reporter Version 1.0
Attached File  TSC_ErrorReporter___V1.0.zip ( 165.91K )Number of downloads: 354

This download is Ac2002/2003 format, but works just fine in a accdb as well. I selected "Any Version", though of course this will not work in a web database.
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 am working on it
API calls needs to be updated if you are using Access 64 bit.
Go to the top of the page
 
jayArr
post Aug 7 2014, 12:00 AM
Post#2



Posts: 1
Joined: 10-February 11



Excellent application and coding! compute.gif
I'm very appreciative of the skill and hard work. thumbup.gif
I have integrated it into my Access 2010 database application (named SecretaryBird) and it works perfectly. like.png
However I think there might be one small omission - a missing line of code in

the subroutine TSCs_FillinForm()
after the line:
TSCf_ErrInfoForm.tb_ErrDetails=mStrInfoForUser
I've added:
TSCf_ErrInfoForm.tb_UserEmail=gsendUserName
Once again
thanks.gif
and BTW
have a drink (or two) on me
guiness.gif wine.gif
you've earned it!
Best regards
John Richardson
Go to the top of the page
 
AlanAnderson
post Aug 6 2015, 02:59 AM
Post#3



Posts: 1,307
Joined: 19-October 12
From: Blantyre, Malawi


Hi,
I have downloaded and am starting to use this wonderful routine.

Many thanks Smiley notworthy.gif

Just a question, I can very easily add line numbers to my code using MZTools.

Is there any reason why I should NOT do so???????

Regards

Alan
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    11th December 2017 - 08:01 PM