How to Handle Error Messages ?

How to Handle Error Messages ?

Post by Jose Celso Carriel de Abr » Thu, 21 Mar 1996 04:00:00

Anynone can tell me how to handle Database Error Messages, that is, how
to obtain a error code or error message programatically ??

Very Thanks,

J. Celso


1. Custom Task Error Handling - Displaying Custom Error Message


I'm currently working on creating a custom task in VB6.
When it comes to error handling, the recommended error
handling procedure in MSDN is to bubble up the error to
the package event sink using oPackageEvent.onError().

--- Sample Code Starts ---

Private Sub CustomTask_Execute(ByVal pPackage As Object,
ByVal pPackageEvents As Object, ByVal pPackageLog As
Object, pTaskResult As DTS.DTSTaskExecResult)
   On Error GoTo errHandler

   ' Business logic
   openConnection(param, param)

   pTaskResult = DTSTaskExecResult_Success
   Exit Sub


   pTaskResult = DTSTaskExecResult_Failure
   if Err.Number=xxxx Then closeConnection

   ' Bubble errors to the package eventsink
   If Not pPackageEvents Is Nothing Then
      pPackageEvents.OnError "CustomTask_Execute method
failed", Err.Number, Err.Source, Err.Description, "",
0, "", True
   End If

   Exit Sub
End Sub

--- Sample Code Ends ---

However, I notice that when error is raised, the specific
error message (Err.Description) will not be displayed on
the DTS Designer execution status dialog box. The only
message I'll get would be "The task reported failure on

I'm not sure if I have done it correctly. Anyone knows how
to get the custom error messages displayed?


Philip Tan

2. Connection to another instance

3. Error handling and custom error messages

4. Moving from dBase for Dos to Win95

5. Error message handling in ASE 11.9.2

6. ROT for max_parallel_servers

7. Handling error messages

8. DLL

9. 2nd POST: How to handle LOCKS error message

10. Error Handling (Suppressing Server Messages)

11. Error Handling (Suppressing System Messages)

12. Handling error messages

13. The handle is invalid Error Message