Click to See Complete Forum and Search --> : error handling


freek
August 20th, 1999, 02:46 AM
I created a database in Oracle and then linked it to an Access database using ODBC.
Can someone tell me how i can trap an error from ODBC or Oracle using VBA?

If I use the error object from VBA it gives me just the code 3146 (odbc call failed) followed by the code 7786 (?). The first code is not always the same, sometimes i get the code 3155 (insert on a listed table failed) but always the second code is 7786. But i need the real error code (from Oracle or ODBC) before i can react to that error.

Lothar Haensler
August 20th, 1999, 02:49 AM
since you keep posting that same question again and again, let me ask one question.
What interface do you use for accessing the database?
if it's DAO you can inspect the DAO Errors Collection after an unsuccessful execution of a command.
It will give you lots of information.

freek
August 20th, 1999, 04:49 AM
I am verry sorry that i kept posting the same message over and over again, but i needed an answer urgent.
I' am using DAO and I already tried to use the error collection, but i got always the same run time error
(3001 invalid argument). I checked the code for a couple of times, cut and paste the example Microsoft gives, but the result was always the same 3001 invalid argument. So I thought the method was no good for ODBC. In reaction to your answer I tried it again and now it worked!? I can't understand why it worked not before, but I am glad that i works now.

Once again my apologies for posting so many times the same question.