DTS module in VB

DTS module in VB

Post by Miguel Salle » Sat, 05 Apr 2003 00:15:24


How can I make it possible to run many packets in sequence
if one of them fails to execute?

The problem is: the module shows a messagebox with the
error message (see below) and I would like it to start a
countdown, if the countdown riches 0 then write a error
file and auto-press OK button.
Is there a way to make a auto-pressing??

Thanks and sorry if I posted this in the wrong place

Public Sub tracePackageError(oPackage As DTS.Package)
Dim ErrorCode As Long
Dim ErrorSource As String
Dim ErrorDescription As String
Dim ErrorHelpFile As String
Dim ErrorHelpContext As Long
Dim ErrorIDofInterfaceWithError As String
Dim i As Integer

        For i = 1 To oPackage.Steps.Count
                If oPackage.Steps(i).ExecutionResult =
DTSStepExecResult_Failure Then
(i).GetExecutionErrorInfo ErrorCode, ErrorSource,
ErrorDescription, _
ErrorHelpContext, ErrorIDofInterfaceWithError
                        MsgBox oPackage.Steps(i).Name & "
failed" & vbCrLf & ErrorSource & vbCrLf & ErrorDescription
                End If
        Next i

End Sub