Handling Error Events

At the highest level, a DTS object property set or get, or method execution succeeds or fails. Every COM interface member function returns an HRESULT value indicating success or failure.

Typically, an Automation controller does not expose the return value of a COM function as the return value of a method. Implementing instance data as properties of an automated object prevents a direct return of the COM object member function implementing property set or get. For the Automation controller, error returns generally cause execution of error trap code.


Note The DTS Package object is implemented as a connectable COM object. Connectable objects raise events that can be handled by application. The Package object implements the OnError event that extends error handling options for DTS client applications. For more information, see Handling Connection Point Events and OnError Event.


Automation Controllers

When using an Automation controller as a development platform, an error return exercises error trap code built into routines. For example, Microsoft® Visual Basic™ implements the On Error statement allowing application direction of response to an abnormal execution condition.

DTS implements support for the Err object; the application can use properties of the object to respond to an error condition.

C/C++

All DTS interfaces support the IErrorInfo interface. With an instance of any DTS object, QueryInterface for an ISupportErrorInfo interface returns a valid interface pointer, and ISupportErrorInfo::InterfaceSupportsErrorInfo returns NOERROR. Therefore, the COM GetErrorInfo function returns an IErrorInterface reference for any error raised by DTS (HRESULT is greater than CO_E_LAST), and the DTS application can avoid querying for ISupportErrorInfo.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.