[AccessD] Error Code Generator

Heenan, Lambert Lambert.Heenan at AIG.com
Fri Sep 22 16:08:31 CDT 2006


Well of course. Even *I* do that! :-)

My error handlers, are in the subs/functions that they serve. They take care
of anticipated errors and allow the program to move on. If the error cannot
be handled ('cuase I didn't think of it!) then I have a standard routine in
a module that reports the error via email and also logs the same information
is an error log table. But that's not *handling* and error, it's just
reporting it, which is why my routine is called

ReportError

Lambert



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of DWUTKA at marlow.com
Sent: Friday, September 22, 2006 2:03 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Error Code Generator


Ah, but some things can be centralized.  For instance, alerting for an
error, recording the error, etc, those are things you want done for every
error (that you aren't expecting).  You still have the individual
errorhandling routines which can be customized for each
situation/procedure).

Drew

-----Original Message-----
From: Heenan, Lambert [mailto:Lambert.Heenan at aig.com] 
Sent: Friday, September 22, 2006 12:57 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Error Code Generator

"Why is it better to embed the error routine in the particular proc or
func". Lot's of reasons, not least of which is:

Because the person who codes a proc/func is in the best position to
determine what action should be taken with which specific error codes, and
it only makes sense the do this in the routine that errored - for one thing
the error handler will have access to all the local variables and parameters
that the routine uses.

Because to write a routine that would know what to do with all x thousand
errors in any code that any programmer ever wrote in any application would
be up for the psychic coder of the century award. :-)

Lambert


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com
Sent: Friday, September 22, 2006 1:33 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Error Code Generator


I didn't write it, but it raises a question that I have wondered about for a
while. Why is it better to embed the error routine in the particular proc or
func than to write one global error handler and pass it the text and perhaps
the proc/func name, so there's only one error handler in the whole app? I
never did understand this. Can anyone provide some insight?

Arthur

----- Original Message ----
From: Martin Reid <mwp.reid at qub.ac.uk>
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
Sent: Friday, September 22, 2006 1:19:04 PM
Subject: [AccessD] Error Code Generator

I believe someone on the list created an error generator. I believe it might
be JC? Anyway I have been using it a lot for code examples and just to be
politically correct want the owner to know. Example below
 
 
Function CopytoWss()
On Error GoTo Err_CopytoWss
    DoCmd.SelectObject acTable, "Contacts"
    DoCmd.RunCommand acCmdExportSharePointList
Exit_CopytoWss:
Exit Function
Err_CopytoWss:
        MsgBox Err.Description, , "Error in Function CopytoWss"
        Resume Exit_CopytoWss
    Resume 0    '.FOR TROUBLESHOOTING
End Function

 
Martin
 




-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list