Export (0) Print
Expand All

IErrorInfo::GetSource

Returns the name of the component that generated the error, such as "ODBC <driver-name>".


HRESULT GetSource (
   BSTR *pbstrSource);

pbstrSource

[out] A pointer to memory in which to return a pointer to the name of the component that generated the error. If an error occurs, *pbstrSource is set to a null pointer. The memory for this string is allocated by the provider and must be freed by the consumer with a call to SysFreeString.

S_OK

The method succeeded.

E_INVALIDARG

pbstrSource was a null pointer.

E_OUTOFMEMORY

The provider was unable to allocate sufficient memory in which to return the component name.

DB_E_NOLOCALE

The locale ID specified by the lcid parameter in IErrorRecords::GetErrorInfo was not supported by the provider.

The implementation of this method in the data access technologies calls IErrorLookup::GetErrorDescription to retrieve the error source.

Show:
© 2014 Microsoft