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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OO4O Error handling

Status
Not open for further replies.

Lemox

Programmer
Dec 13, 2003
67
GB
Hi,

I'm in trouble with OO4O and its OIP errors : I cannot propagate them to the calling procedure.

In my Form :
------------
MyObject.Edit
'apply modifications... blabla
MyObject.Update

Class CMyObject:
-----------------
Private rst as oradynaset

Public Sub Edit()
On error goto Err_Handle
rst.Edit
exit sub

errHandle:
MsgBox("Error")
End Sub

The problem is that if the error occurs in the class, the calling procedure of the form doesn't know that an error has occured. I tried to delete the error handler in the class and to write one in the calling procedure, so the error should be propagated to the calling procedure but it is not !

Any idea ?
Making the Edit method a function returning codes could work but I don't want to check the error codes in the calling procedure and display related message...

Thanks
Lemox
 

Lemox, have you had any luck figuring out your problem?

Good Luck

 
Hi,

Well, I trapped the error by another turnaround...

Err.Number is always 440 (Automation Error)
and
Err.Description is "OIP-xxxx : blabla..." so I check the code "xxxx" (substring with Left,...)
and do a select case with it in the calling procedure.

A bit "tricky & dirty" but the ready-to-use Orasession.LastServerErr always return 0 (I don't know why...) and I don't have too much time to waste.

Anyway, maybe this will help someone ;-)
Thanks for asking, vb5prgrmr !

Lemox


ps : I'm pretty sure that OO4O interrupts the error management process (there's something like that with Excel explained in MSDN) so the raise didn't work.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top