473,614 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access: Crash Reporter / Error mailer

TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Introduction
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
  1. Error ID:F9AE94266E3943DBB1D664959A33868F
  2. ==== Error Message as presented to user ====
  3. Error 91 has occurred in procedure [cmdCauseError_Click] in module [TSC_ErrRep_frm_Test_ErrorReportTool]
  4. Object variable or With block variable not set
  5.  
  6. This error was raised in order to test the Error report functionality
  7.  
  8. ==== Error Number ====
  9. 91
  10.  
  11. ==== Error Line (0 if N/A) ====
  12.  
  13.  
  14. ==== Error Description ====
  15. Object variable or With block variable not set
  16.  
  17. ==== Error in Module ====
  18. TSC_ErrRep_frm_Test_ErrorReportTool
  19.  
  20. ==== Error in Procedure ====
  21. cmdCauseError_Click
  22.  
  23. ==== Session Information ====
  24. ==== Application Information ====
  25. Name : TSC_ErrorReporter – BETA.mdb
  26. Path : C:\Users\Documents\Applications\ErrorReport\TSC_ErrorReporter – BETA.mdb
  27. Active Form : TSC_ErrRep_frm_Test_ErrorReportTool
  28. Active Control : cmdCauseError
  29. Parent Form(if any) : TSC_ErrRep_frm_Test_ErrorReportTool
  30. Active Datasheet : N/A
  31. Active Report : N/A
  32. Open forms : TSC_ErrRep_frm_Test_ErrorReportTool
  33.  
  34. ==== Access Info ====
  35. Version : 14.0
  36. Build : 6024
  37. Fileformat : 10
  38. DB Version : 4.0
  39. ==== Time of Error ====
  40. 15-03-2013 15:01:55
  41.  
  42. ==== Windows User Name ====
  43. aec
  44.  
  45. ==== Active Form ====
  46. TSC_ErrRep_frm_Test_ErrorReportTool
  47.  
  48. ==== Active Control ====
  49. cmdCauseError
  50.  
  51. ==== Active Control Parent Form ====
  52. TSC_ErrRep_frm_Test_ErrorReportTool
  53.  
  54. ==== Active Data Sheet ====
  55. N/A
  56.  
  57. ==== Active Report ====
  58. N/A
  59.  
  60. ==== All Open Forms ====
  61. TSC_ErrRep_frm_Test
  62.  
  63. ==== Application Version ====
  64. 1.0
  65.  
  66. ==== TheSmileyCoders Crash Reporter Version Info ====
  67. 1.0
  68.  
  69. ==== Application Version ====
  70. 1.0
  71.  
  72. ==== Minutes application has been running ====
  73. 157
  74.  
  75. ==== Hours since last Windows reboot ====
  76. 7
What else can it do?

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:
http://www.youtube.com/watch?v=V08Utrd2Xgo


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
  1. ‘***************************************************************************************
  2. ‘ – Err reporter settings
  3. ‘***************************************************************************************
  4.  
  5. ‘Place YOUR email here, the email which the reports should be sent to
  6. Public Const gReportErrorToEmail As String = “YourEmail@SomeWhere.com”
  7.  
  8. ‘Place the name of your application in here. It will be used in various message boxes and captions
  9. Public Const gAppName As String = “TheSmileyCoders Report Tool”
  10.  
  11. ‘Place the name of your company, or your own name here
  12. Public Const gDeveloperName As String = “TheSmileyCoder”
  13.  
  14. ‘Choose whether to use Outlook or CDO for mail
  15. Public Const gUseOutlook As Boolean = True
  16.  
  17. ‘Place details on the Gmail account for which to use CDO to send error message
  18. Public Const gSendUserName As String = “”
  19. Public Const gSendPassword As String = “”
  20.  
  21. ‘Set whether or not to take a screenshot, and whether to include it per default
  22. Public Const gTakeScreenshot As Boolean = True
  23. Public Const gDefaultSubmitScreenshot As Boolean = True
  24.  
  25. ‘Whether or not to dim the background as the submit error form is opened
  26. Public Const gDimBackground As Boolean = True ‘Default is true
  27.  
  28. ‘Version of Error report tool in use
  29. Public Const gErrorReportToolVersion As String = “1.0″
  30.  
  31. 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:
  32.  
  33. ‘Choose whether to use Outlook or CDO for mail
  34. Public Const gUseOutlook As Boolean = False
  35.  
  36. ‘Place details on the gmail account for which to use CDO to send error msg
  37. Public Const gSendUserName As String = “YourExtraEmail@gmail.com”
  38. 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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCode()
  2. On Error goto ErrHandler
  3.  
  4.  'Some code
  5.  
  6. ExitSub:
  7.   Exit Sub
  8.  
  9. ErrHandler:
  10.   Msgbox Err.Number & " - " & err.Description
  11.   Resume ExitSub
  12.  
  13. 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:

Expand|Select|Wrap|Line Numbers
  1. 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 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.
Apr 7 '13 #1
17 4375
MMcCarthy
14,534 Recognized Expert Moderator MVP
Thanks Smiley, I will definitely find this one useful :) I'll be implementing it on my next project and will give you feedback when it's running with the client. Probably won't be for a while. I think it may become one of my "must have" tools.
Apr 9 '13 #2
Meetee
931 Recognized Expert Moderator Contributor
Great Smiley, seems very useful and nicely described!

Where is Thumb Up button? :)
Apr 9 '13 #3
Seth Schrock
2,965 Recognized Expert Specialist
@Smiley I had read that it wasn't the best idea to send error messages as emails as it created a risk of an error occurring in the error handler which would either cause an infinite loop if the error was handled or make it so that the error message was lost if the error wasn't handled. What is your opinion on this?
Apr 9 '13 #4
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
@Mary and Meetee
Thank you for your feedback, I hope you find it useful.

@Seth:
None of the functions used in the tool call the Error Mailer. So you should not enter a infinite loop. Furthermore I have used alot of time to setup the mailer so that it is "error resistent", I.e. it will continue to run til it reaches the end. Some of the information collection routines are setup so that if they should error, they will simply return something like:
"Access Version: Error getting Access Version"

Of course you are correct that it is a issue that merits consideration, but I do believe I have tried to take into consideration within the code.
Apr 9 '13 #5
Seth Schrock
2,965 Recognized Expert Specialist
Great! I will add this to my database that I'm about to roll out and see how it works.

I guess the real trick is to make it so that you don't need the error handler very often :)
Apr 9 '13 #6
Lysander
344 Recognized Expert Contributor
This looks a fantastic idea. Two questions.
1)Is your application itself written in Ms-Access VBA or in Visual Basic (what I don't have)
2) Is it possible to have the report saved to a file on the generating pc, to be emailed independtly. The reason for this is most of my users are on laptops out in the field, with no telephone, no internet, indeed no electricity, so they would need to save the error report, and then email once they get back to base and have access to the internet.

Very interesting idea.
Apr 10 '13 #7
Seth Schrock
2,965 Recognized Expert Specialist
This is incredible Smiley. I just tried it out and I love it. The only thing is that sometimes it takes several seconds from clicking the button to getting the error form open. Sending the email goes quick. I love all the information that it gathers along with the screen shots. It sure seems "user proof" to me :)
Apr 10 '13 #8
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
@Lysander
1) It is written in Access VBA. It does also rely on several windows API calls, but nothing besides that. Everything is visible and available in the sample. The zip is not code-locked.

2) The textual part of the report and the images are saved to the users temp folder (I am guessing that is the least likely folder path to be restricted access by IT, but it is really just a guess). There is actually a function in there that checks for internet connectivity (Although it can be fooled by being connected to a LAN that doesn't have internet if I recall correctly). Anyways, you could probably use that and store whether the report has been sent or not. There is no built-in support for it yet though. I did once have a simpler error reporter which didn't take screenshots. It stored all errors locally, and then each time during startup it would try to transfer all local errors to a server table, and if successful delete them from the local table. So it is certainly doable. I don't think its something I will build in any time soon though. Too many other projects I find more interesting :)
Apr 10 '13 #9
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
@Seth
Did you enable the WMI information gathering? That function takes quite a bit of time. If you have linked backend access tables which are not available I also imagine it could take a bit of time to run, since it times out on trying to collect information on them.
Apr 10 '13 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
18043
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out on me for some reason. The Summary field is pulled from a Rich Text Editor that allows HTML formatting and appears to be the culprit, but I just can't seem to figure out why. Any guidance is greatly appreciated. I'm connecting to an Access...
2
2203
by: Mark Loveless | last post by:
Back in my mainframe days a crash dump could be parsed by hand to reveal the application program running at crash time as well as the offset into said program, which combined with a extended program listing could be used to determine the partcular application program statement that killed the thing. I realize this is a totally different world, but is there a way at least to determine which form had control at access-decides-to-croak...
4
3525
by: hinrich | last post by:
Hello, I have a completely new system (windows xp prof.), office xp 2002 with sp 3. When I create a new and empty Accesss database, create an empty table and then create a new form using a wizard, Access 2002 crashes when I go to the next record using the little black arrow at the bottom of the form...
2
4024
by: Lenin Torres | last post by:
Hi everybody I have an Union Query that works fine. I used this query as the RecordSource for a Form. That Form is used as a subform in another form. Everything works fine, except for the "Filter by form" feature. When the user tries to use Filter by form a messagebox is displayed: "There are too many controls in this form to perform a filter by form", after that,when the user exit the Filter by Form mode, Access crash, displaying a...
5
1692
by: David | last post by:
I'm developing an ASP.NET application to run on Win2K server with IIS 5.1, which has run perfectly happily in various development, test and staging environments. I've recently deployed it on one of our production servers and I'm getting an intermittent 'Access is denied' error when pages are loading. The file being accessed is an xml globalisation file that is used to load the text for the page according to the language settings of the...
2
5079
by: ajain1008 | last post by:
I'm running the following code on asp.net form Dim objExcel As Excel.Application Dim objWrkBk As excel.Workbook objExcel = New excel.Application objWrkBk = objExcel.Workbooks.Open("C:\Inetpub\wwwroot\ret\ret.xls") objWrkBk.Close(SaveChanges:=True) objWrkBk = Nothing objExcel.Quit() objExcel = Nothing
0
755
by: bazzer | last post by:
hey, i am using visual basic.net 2003 and have an ASP.NET webform application thats accessing a microsoft access 2003 database. i kept getting the following error when i tried to run it: ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR Driver's SQLSetConnectAttr failed ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN...
0
12030
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in '/CinemaBookingSystem' Application. -------------------------------------------------------------------------------- ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process
2
8023
by: Paolo | last post by:
Hi to all, I have an error that drove me crazy. Try the following page that should only allow to upload a file: <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body>
1
1802
by: shef1 | last post by:
Hi All, I am consuming a third party web service.I am getting "access forbidden 403 error web service eror".Can anyone help me. Thanks
0
8620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8265
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8423
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5537
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4048
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4115
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2560
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1420
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.