Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


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

HRESULT GetSource (
   BSTR *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.


The method succeeded.


pbstrSource was a null pointer.


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


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.

© 2015 Microsoft