Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trapping ODBC Errors
Message
Information générale
Forum:
Microsoft Office
Catégorie:
Access
Titre:
Trapping ODBC Errors
Divers
Thread ID:
00500422
Message ID:
00500422
Vues:
48
Hi Everyone,
If anyone has any insight into this issue, I would be very grateful.

I'm using an ODBC connection to an Oracle database through Access 97. I'm running reports for which the data source is a pass-through query. If the pass-through query refers to a view or a column within a view that no longer exists, Oracle will generate an error. I would like to present that error to the user. I can examine the DbEngine.Errors() collection, but I'm running into a problem:

Within a report, Access executes the query on my behalf. At that point, Access jumps out of VBA code and tries to execute the query. I can only trap for errors after it returns. When I do that, the Errors() collection contains a Jet error that doesn't appear to have anything to do with the Oracle problem. The actual Oracle error is nowhere to be found. However, when I execute that same pass-through query through an ODBCDirect connection instead of letting the report do it for me, the Errors() collection contains the Oracle error.

Unfortunately, because Access executes the report query on my behalf, it doesn't appear that I can run the report query through ODBC direct to retrieve the error I want and, because Access seems to place any error it wants into the errors collection when IT runs the report query, I can't retrieve the actual Oracle error.

Does anyone have any idea how I might be able to obtain the Oracle error after Access executes the query for me? I've been pouring over the Microsoft site and can't seem to find any articles that deal specifically with this. All of the examples I've found so far are for queries executed through code which isn't quite the same thing.

John
John Groft
Consultant
Computer Task Group, Inc.
Répondre
Fil
Voir

Click here to load this message in the networking platform