Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help: EOleException and Oracle Errors

Status
Not open for further replies.

JediDan

Programmer
May 15, 2002
128
US
Help!

I'm trying to trap Oracle errors coming through an ADO connection, and I find the exception property that contains the actual Oracle error number.

Thanks to help from Oppenheimer, I've discovered that ADO returns exceptions of name: EOleException, but I can't find a .SQLCode or .ErrorCode property.

Anyone have any insight into EOleException?

I appreciate any suggestions at all.
 
I may be wrong, but the error details you are seeking are in the Errors collection/Error object associated with the ADO connection. you won't get the information from EOleException. All EOleException does is alert you. When it is raised, check how many errors there are from the ADO connection and loop through them to get the SQLState and error description. Also, make sure you reset/clear them from the ADO connection.

 
Thanks for your help... I found there was an ADO error occuring, but NativeError returns 0, which is supposed to indicate that the error doesn't reside on the remote server. However, once I get past this message, I still get an error box saying "Error trying to retrieve text for Error ORA-12154."

So, I still haven't been able to trap the 12154 (or any other Oracle error #)... SQLState returns nothing, and when I do connection.errors.item.number, I get the same error number as when accessing the EOleException information.

Any thoughts?

Thanks,

Dan
 
Based on your specific problem, you may be experiencing a connection problem. If this is the case, you won't get the details you are seeking, because there isn't a link. You should try Google and search for ORA 12154. Here is a link that gives details on the error.


I hope this will help you.
 
What I am trying to trap here is when a user enters and invalid database name (we have dozens available), and it's very common for typos to occur.

So in this instance, there is no database to connect to but somehow there still is an error message about ORA-12154.

But I have the same problem when entering an incorrect password or user ID for a valid database. I get a message saying 'Error trying to retrieve text for ORA-01017'.

I know what these error codes mean, and somehow they're getting generated and passed to the app, but I have no idea how to isolate just the number so I can handle it.

Any ideas?

Thanks again for your help, I really appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top