ERRORINFO Structure

OLE DB Programmer's Reference

The ERRORINFO structure returns most of the basic information associated with an error:

typedef struct tagERRORINFO {    HRESULT   hrError;    DWORD     dwMinor;    CLSID     clsid;    IID       iid;    DISPID    dispid; } ERRORINFO;

The elements of this structure are used as described in the following table.

Element Description
hrError The code returned by the method. This might be different in different records in the error object. For example, suppose a query processor service component opens rowsets provided by base table data providers. If ICommand::Execute in the query processor calls IOpenRowset::OpenRowset in a base table data provider and OpenRowset fails with DB_E_NOTABLE, Execute might return DB_E_ERRORSINCOMMAND.
dwMinor A provider-specific error code.
clsid The class ID of the object that returned the error.
iid The interface ID of the interface that generated the error. The value of iid can be different from the ID of the interface that defines the method the consumer called. For example, if a consumer calls If ICommand::Execute in a query processor and if the query processor then calls IOpenRowset::OpenRowset in a base table data provider and OpenRowset fails, iid is IID_IOPENROWSET, not IID_ICOMMAND.

If the method that generates an error belongs to more than one interface because of inheritance, this value is the ID of the first interface in which the method is defined. For example, suppose IRowsetLocate::GetRowsAt is called through a pointer to IRowsetScroll, which inherits from IRowsetLocate. If GetRowsAt fails, iid is IID_IROWSETLOCATE, not IID_IROWSETSCROLL.

dispid Optional and provider-specific. Could be used, for example, to indicate the method that returned the error.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net