PDA

Click to See Complete Forum and Search --> : Error Trapping


Mike Beardshall
Aug 2nd, 1999, 10:16 PM
hi everyone, im pretty stuck.
I have a project which works off an oracle and access database.
The problem is that I want to find a way of recording where an error occurred.
An error could occur:
1. within VB
2. within the ODBC Jet Driver for Access
3. within the ODBC driver for Oracle
4. within the oracle database
5. within the access database
I need to produce a standard error message and write the trapped error details to an error log but I don't know how to always know where the error originated.

Any help would save my life cos im really stuck

many thanks in advance

AaronC
Aug 3rd, 1999, 02:50 AM
Here is the standard error message I use:
msgbox "Error- " & err.Description & " (" & Err.Number & ")"

I think the description it provides might give you enough info to figure out where it came from. To log the errors, if you have one central error handling routine that you call when you run into an error that shows any messages you want and then writes that same message (along with other info you might want) to a file.

bashfirst
Aug 3rd, 1999, 04:10 PM
make sure you consider that ODBC errors from Oracle are cntained in a collection. VB will usually give you a 3146 - ODBC Error (which doesn't help much)... but if you iterate thru Errors() you can get the Oracle error that returned. This is a good reason to have all your data access handled in one place so that you can have a specific error handler for the numerous errors you might get.

Bash