This content has been marked as final. Show 4 replies
Prior to calling and after calling the CreateDynaset method use the LastServerErr functionality as such...
dbOra.LastServerErrReset 'Clear Error on Oracle OLE Object
Set rsOraLC = dbOra.CreateDynaset("SELECT * FROM dbo.Language_Control", ORADYN_READONLY)
'Force Error Handling for Oracle
If Not (dbOra.LastServerErr = 0) Then
Err.Raise 440, "Oracle Automation (OO4O)", _
"( " & dbOra.LastServerErr & " ) - " & _
dbOra.LastServerErrText & vbLf & _
"Position: " & dbOra.LastServerErrPos
Do note, there are three diferent ways OO4O traps errors that may not be seen by the hosting langauge. The two most common being LastServerErr on both the Session and Database objects. The least know is the LastErrorText property of the OraParamArray object.
I tried the code but it doesn't seems to work. Let me clarify my problem. It is with "OpenDatabase". When I entered the wrong password. VB trapped the error and display the standard error pop-up panel showing "Runtime Error 440:" with the appropriate ORACLE error message. I would like to trap it and prompt the user to re-enter the userid/password. I'm just wondering if there's a set of command to tell VB to not trap the OO4O errors and let the application handle it?
P.S. I'm using VB under Access 2000.
Do the On Error Resume Next as you were and test the LastServerErr property for the value of '1017' (ORA-01017) after your OpenDatabase call.
The problem was setting in MS Access. Somehow on my machine the Error Trapping 'Option' is set to Trap all error. Everything worked like a charm after I changed it to 'Trap Only Unhandled Error'.