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

Retrieving Step Error Information

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
0
0
AU
SQL Server 2000.

I am building a generic error trapping routine in the last step of a DTS Package. The problem I am getting in the early stages is that this form of the command works:
.GetExecutionErrorInfo (lpErrorCode)
This form does not
.GetExecutionErrorInfo lpErrorCode, ErrSource,ErrDescription
It complains about a type mismatch.
The ErrSource and ErrDescription are of course where the
valuable information is stored. Thanks.

Full code here:


Code:
Function Main()
	Main = DTSTaskExecResult_Success
	'*****Call  Email_Status("","Success","Process HL7 Batch Files", "All completed ", strEmail_Extra_Text)
	iStatus = True
	Dim lpErrorCode
	Dim ErrSource
	Dim ErrDescription
	lpErrorCode = -1
	
	Dim  oPackage	
	set oPackage = DTSGlobalVariables.parent  
	For i = 1 To oPackage.Steps.Count
        	If oPackage.Steps(i).ExecutionResult = DTSStepExecResult_Failure Then
	With oPackage.Steps(i)
		'.GetExecutionErrorInfo lpErrorCode, ErrSource, ErrDescription
		.GetExecutionErrorInfo (lpErrorCode)
		msgbox oPackage.Steps(i).Name 
		msgbox  lpErrorCode
	End With
            iStatus = False
           
        End If
    Next 

			
End Function

The risk with keeping an open mind is having your brains fall out.
Shaunk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top