다음을 통해 공유


IErrorInfo::GetSource

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

Syntax

HRESULT GetSource (
   BSTR *pbstrSource);

Parameters

  • 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.

Return Code

  • 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.

Comments

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

See Also

Reference

IErrorLookup::GetErrorDescription