GetExecutionErrorInfo Method

DTS Programming

DTS Programming

GetExecutionErrorInfo Method

The GetExecutionErrorInfo method returns details about step execution failure.

Applies To
Step Object Step2 Object
Syntax

object.GetExecutionErrorInfo pErrorCode, [pbstrSource], [pbstrDescription], _
    [pbstrHelpFile], [pHelpContext], [pbstrIDofInterfaceWithError]

Part Description
Step Expression that evaluates to an object in the Applies To list
pErrorCode Error code of the failure
pbstrSource Source of error
pbstrDescription Description property of the error
pbstrHelpFile Help file name
pHelpContext Help context ID
pbstrIDOfInterface
WithError
ID of the interface returning the error

Remarks

Step2 object failure is separate from Package2 object failure. Therefore, error information for each step is unavailable from the COM IErrorInfo object or the Microsoft® Visual Basic® Err object.

When a step fails, the package will not fail unless the package FailOnError property or the step FailPackageOnError property is set. The error that is raised will only specify the step that failed, not the error that occurred. Use GetExecutionErrorInfo on the step that failed to get information about the error.

If you do not set either FailOnError or FailPackageOnError for any step, you can use GetExecutionErrorInfo on all steps in the Steps collection when package execution completes. GetExecutionErrorInfo returns meaningful information only when the step ExecutionStatus is DTSStepExecStat_Completed and ExecutionResult is DTSStepExecResult_Failure.

Prototype (C/C++)

HRESULT GetExecutionErrorInfo(
    long *pErrorCode,
    BSTR *pbstrSource,
    BSTR *pbstrDescription,
    BSTR *pbstrHelpFile,
    long *pHelpContext,
    BSTR *pbstrIDofInterfaceWithError);

See Also

ExecutionResult Property

ExecutionStatus Property

FailOnError Property

FailPackageOnError Property

Handling DTS Events and Errors

Steps Collection