MDAC 2.5 SDK - OLE DB Programmer's Reference
OLE DB Interfaces


 

IErrorInfo::GetDescription

Returns a text description of the error.

HRESULT GetDescription (
   BSTR * pbstrDescription);

Parameters

pbstrDescription

[out]
A pointer to memory in which to return a pointer to a string that describes the error. If there is no error description or an error occurs, the returned value (*pbstrDescription) 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

pbstrDescription was a null pointer.

E_OUTOFMEMORY

The provider was unable to allocate sufficient memory in which to return the error description.

DB_E_NOLOCALE

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

Comments

If the lookup ID is IDENTIFIER_SDK_ERROR, the implementation of this method retrieves the error description from the error resource DLL shipped with the MDAC SDK. Otherwise, IErrorInfo::GetDescription calls IErrorLookup::GetErrorDescription to retrieve the string. If the description is parameterized, such as "Cannot open table <param1>," the lookup service incorporates the parameter values before returning the string.

See Also

IErrorLookup::GetErrorDescription