|
|
|
IErrorInfo Interface |
|
IID |
{1CF2B120-547D-101B-8E65-08002B2BD119} |
|
IErrorInfo is defined by Automation; the following describes how the interface is used in OLE DB. IErrorInfo returns information about an error in addition to the return code. It returns the error message, name of the component and GUID of the interface in which the error occurred, and the name and topic of the Help file that applies to the error.
IErrorInfo is implemented by code in the Microsoft® Data Access Components (MDAC) SDK. This code calls provider-specific code in IErrorLookup to retrieve error messages, sources, and Help file information.
OLE DB error objects expose IErrorInfo at two levels. First, it is exposed on the OLE DB error object itself, which enables Automation consumers to use OLE DB error objects. The interface pointer is returned by IErrorRecords::GetErrorInfo in the Automation DLL; it can also be returned by QueryInterface. IErrorInfo returns the information stored in record 0 of the OLE DB error object and uses the default locale ID.
IErrorInfo is also exposed on individual records in the OLE DB error object. These IErrorInfo interface pointers, returned by IErrorRecords::GetErrorInfo, are different from the IErrorInfo interface pointer exposed on the OLE DB error object itself and cannot be returned by QueryInterface. The record to which the interface pointer applies and the locale ID it uses are specified by the consumer in IErrorRecords::GetErrorInfo.
Automation consumers call IErrorRecords::GetErrorInfo in the Automation DLL to get an IErrorInfo interface pointer on the OLE DB error object.
OLE DB consumers also call IErrorRecords::GetErrorInfo in the Automation DLL. However, they do not generally use the returned IErrorInfo interface pointer. Instead, they call QueryInterface to get an IErrorRecords interface pointer and then call IErrorRecords::GetErrorInfo to get an IErrorInfo interface pointer on a particular record in the OLE DB error object. Then the OLE DB consumers use this interface pointer to retrieve the error information.
Documentation: IErrorInfo
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IErrorInfo Methods |
Description |
|
GetGUID |
Returns the GUID of the interface that defined the error. |
|
GetSource |
Returns the name of the component that generated the error, such as "ODBC driver-name". |
|
GetDescription |
Returns a text description of the error. |
|
GetHelpFile |
Returns the path of the Help file that describes the error. |
|
GetHelpContext |
Returns the Help context ID for the error. |
|
QueryInterface |
|
FUNCTION OLEDB_IErrorInfo_QueryInterface ( _ BYVAL pthis AS DWORD PTR _ , BYREF riid AS GUID _ , BYREF ppvObj AS DWORD _ ) AS LONG
END FUNCTION
|
|
AddRef |
|
FUNCTION OLEDB_IErrorInfo_AddRef ( _ BYVAL pthis AS DWORD PTR _
)
AS DWORD
LOCAL DWRESULT
AS LONG END FUNCTION
|
|
Release |
|
FUNCTION OLEDB_IErrorInfo_Release ( _ BYVAL pthis AS DWORD PTR _
)
AS DWORD
LOCAL DWRESULT
AS DWORD END FUNCTION
|
|
GetGUID |
|
FUNCTION OLEDB_IErrorInfo_GetGUID ( _ BYVAL pthis AS DWORD PTR _ , BYREF pguid AS GUID _
) AS LONG
|
|
GetSource |
|
FUNCTION OLEDB_IErrorInfo_GetSource ( _ BYVAL pthis AS DWORD PTR _ , BYREF strSource AS STRING _
) AS
LONG
strSource = ACODE$(strSource)
|
|
GetDescription |
|
FUNCTION OLEDB_IErrorInfo_GetDescription ( _ BYVAL pthis AS DWORD PTR _ , BYREF strDescription AS STRING _
)
AS LONG
strDescription = ACODE$(strDescription)
|
|
GetHelpFile |
|
FUNCTION OLEDB_IErrorInfo_GetHelpFile ( _ BYVAL pthis AS DWORD PTR _ , BYREF strHelpFile AS STRING _
)
AS LONG
strHelpFile = ACODE$(strHelpFile)
|
|
GetHelpContext |
|
FUNCTION OLEDB_IErrorInfo_GetHelpContext ( _ BYVAL pthis AS DWORD PTR _ , BYREF pdwHelpContext AS DWORD _
)
AS LONG
|
Page last updated on Wednesday, 15 February 2006 23:29:59 +0100