I have two procedures procA and procB. procA calls procB. An exception occurs in procB. I can handle the exception in procB, but I like to handle it in procA, and this is what I could not work. I am not very familiar with VB6, but I think it should be possible because MSDN says:
If an error occurs when an error handler is active (between the occurrence of the error and the Resume, Exit Sub, Exit Function, or Exit Property operation), the current procedure error handler cannot handle this error. Control returns to the calling procedure. If the calling procedure has a valid error handler, it is activated to handle the error.
What am I doing wrong?
Now snippets of code:
Private Sub procA()
On Error GoTo ErrHnd
...
procB obj
Exit Sub
ErrHnd:
MsgBox Err.Description, vbInformation, Me.caption
End Sub
Public Sub procB(ByRef rec As Object)
On Error GoTo ErrHnd
... Exception occurs within DAO Recordset Operation
Exit Sub
ErrHnd:
Select Case Err.Number
Case 3022
Err.Raise vbObjectError + 9999, Err.Source, "Error Text"
Case Else
...
End Select
End Sub
procB (On Error Goto 0), , procA Exception.
.
: :
- DAO.Recordset.
- procB .
- procA , procB (data.cls, frmListArtikel.frm).
: , , . IDE, Exception procA. EXE ( IDE) , Exception procA.