description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CDBErrorInfo Class |
CDBErrorInfo Class |
11/04/2016 |
|
|
9a5c18a2-ee3e-40f5-ab4c-581288d7f737 |
Provides support for OLE DB error processing using the OLE DB IErrorRecords interface.
class CDBErrorInfo
Header: atldbcli.h
Name | Description |
---|---|
GetAllErrorInfo | Returns all error information contained in an error record. |
GetBasicErrorInfo | Calls IErrorRecords::GetBasicErrorInfo to return basic information about the specified error. |
GetCustomErrorObject | Calls IErrorRecords::GetCustomErrorObject to return a pointer to an interface on a custom error object. |
GetErrorInfo | Calls IErrorRecords::GetErrorInfo to return an IErrorInfo interface pointer to the specified record. |
GetErrorParameters | Calls IErrorRecords::GetErrorParameters to return the error parameters. |
GetErrorRecords | Gets error records for the specified object. |
This interface returns one or more error records to the user. Call CDBErrorInfo::GetErrorRecords first, to get a count of error records. Then call one of the access functions, such as CDBErrorInfo::GetAllErrorInfo, to retrieve error information for each record.
Returns all the types of error information contained in an error record.
HRESULT GetAllErrorInfo(ULONG ulRecordNum,
LCID lcid, BSTR* pbstrDescription,
BSTR* pbstrSource = NULL,
GUID* pguid = NULL,
DWORD* pdwHelpContext = NULL,
BSTR* pbstrHelpFile = NULL) const throw();
ulRecordNum
[in] The zero-based number of the record for which to return error information.
lcid
[in] The locale ID for the error information to be returned.
pbstrDescription
[out] A pointer to a text description of the error or NULL if the locale is not supported. See Remarks.
pbstrSource
[out] A pointer to a string containing the name of the component that generated the error.
pguid
[out] A pointer to the GUID of the interface that defined the error.
pdwHelpContext
[out] A pointer to the help context ID for the error.
pbstrHelpFile
[out] A pointer to a string containing the path to the help file that describes the error.
S_OK if successful. See IErrorRecords::GetErrorInfo in the OLE DB Programmer's Reference for other return values.
The output value of pbstrDescription is obtained internally by calling IErrorInfo::GetDescription
, which sets the value to NULL if the locale is not supported, or if both of the following conditions are true:
-
the value of lcid is NOT U.S. English and
-
the value of lcid is NOT equal to the value returned by GetUserDefaultLCID.
Calls IErrorRecords::GetBasicErrorInfo to return basic information about the error, such as the return code and provider-specific error number.
HRESULT GetBasicErrorInfo(ULONG ulRecordNum,
ERRORINFO* pErrorInfo) const throw();
See IErrorRecords::GetBasicErrorInfo in the OLE DB Programmer's Reference.
A standard HRESULT.
Calls IErrorRecords::GetCustomErrorObject to return a pointer to an interface on a custom error object.
HRESULT GetCustomErrorObject(ULONG ulRecordNum,
REFIID riid,IUnknown** ppObject) const throw();
See IErrorRecords::GetCustomErrorObject in the OLE DB Programmer's Reference.
A standard HRESULT.
Calls IErrorRecords::GetErrorInfo to return an IErrorInfo interface pointer to the specified record.
HRESULT GetErrorInfo(ULONG ulRecordNum,
LCID lcid,IErrorInfo** ppErrorInfo) const throw();
See IErrorRecords::GetErrorInfo in the OLE DB Programmer's Reference.
A standard HRESULT.
Calls IErrorRecords::GetErrorParameters to return the error parameters.
HRESULT GetErrorParameters(ULONG ulRecordNum,
DISPPARAMS* pdispparams) const throw();
See IErrorRecords::GetErrorParameters in the OLE DB Programmer's Reference.
A standard HRESULT.
Gets error records for the specified object.
HRESULT GetErrorRecords(IUnknown* pUnk,
const IID& iid,
ULONG* pcRecords) throw();
HRESULT GetErrorRecords(ULONG* pcRecords) throw();
pUnk
[in] Interface to the object for which to get error records.
iid
[in] The IID of the interface associated with the error.
pcRecords
[out] A pointer to the (one-based) count of error records.
A standard HRESULT.
Use the first form of the function if you want to check which interface to get the error information from. Otherwise, use the second form.
DBViewer
OLE DB Consumer Templates
OLE DB Consumer Templates Reference