แก้ไข

แชร์ผ่าน


IErrorRecordsImpl Class

Implements the OLE DB IErrorRecords interface, adding records to and retrieving records from a data member (m_rgErrors) of type CAtlArray<RecordClass>.

Syntax

template <class T, class RecordClass = ATLERRORINFO>
class IErrorRecordsImpl : public IErrorRecords

Parameters

T
A class derived from IErrorRecordsImpl.

RecordClass
A class that represents an OLE DB error object.

Requirements

Header: atldb.h

Members

Methods

Name Description
GetErrorDescriptionString Gets the error description string from an error record.
GetErrorGUID Gets the error GUID from an error record.
GetErrorHelpContext Gets the help context ID from an error record.
GetErrorHelpFile Gets the full pathname of the help file from an error record.
GetErrorSource Gets the error source code from an error record.

Interface Methods

Name Description
AddErrorRecord Adds a record to the OLE DB error object.
GetBasicErrorInfo Returns basic information about the error, such as the return code and provider-specific error number.
GetCustomErrorObject Returns a pointer to an interface on a custom error object.
GetErrorInfo Returns an IErrorInfo interface pointer on the specified record.
GetErrorParameters Returns the error parameters.
GetRecordCount Returns the number of records in the OLE DB record object.

Data Members

Name Description
m_rgErrors An array of error records.

IErrorRecordsImpl::GetErrorDescriptionString

Gets the error description string from an error record.

Syntax

LPOLESTR GetErrorDescriptionString(ERRORINFO& rCurError);

Parameters

rCurError
An ERRORINFO record in an IErrorInfo interface.

Return Value

A pointer to a string describing the error.

IErrorRecordsImpl::GetErrorGUID

Gets the error GUID from an error record.

Syntax

REFGUID GetErrorGUID(ERRORINFO& rCurError);

Parameters

rCurError
An ERRORINFO record in an IErrorInfo interface.

Return Value

A reference to a GUID for the error.

IErrorRecordsImpl::GetErrorHelpContext

Gets the help context ID from an error record.

Syntax

DWORD GetErrorHelpContext(ERRORINFO& rCurError);

Parameters

rCurError
An ERRORINFO record in an IErrorInfo interface.

Return Value

The help context ID for the error.

IErrorRecordsImpl::GetErrorHelpFile

Gets the path name of the help file from an error record.

Syntax

LPOLESTR GetErrorHelpFile(ERRORINFO& rCurError);

Parameters

rCurError
An ERRORINFO record in an IErrorInfo interface.

Return Value

Pointer to a string that contains the path name of the help file for the error.

IErrorRecordsImpl::GetErrorSource

Gets the source code that caused the error from an error record.

Syntax

LPOLESTR GetErrorSource(ERRORINFO& rCurError);

Parameters

rCurError
An ERRORINFO record in an IErrorInfo interface.

Return Value

Pointer to a string containing the source code for the error.

IErrorRecordsImpl::AddErrorRecord

Adds a record to the OLE DB error object.

Syntax

STDMETHOD(AddErrorRecord )(ERRORINFO *pErrorInfo,
   DWORD dwLookupID,
   DISPPARAMS *pdispparams,
   IUnknown *punkCustomError,
   DWORD dwDynamicErrorID);

Parameters

See IErrorRecords::AddErrorRecord in the OLE DB Programmer's Reference.

IErrorRecordsImpl::GetBasicErrorInfo

Returns basic information about the error, such as the return code and provider-specific error number.

Syntax

STDMETHOD(GetBasicErrorInfo )(ULONG ulRecordNum,
   ERRORINFO *pErrorInfo);

Parameters

See IErrorRecords::GetBasicErrorInfo in the OLE DB Programmer's Reference.

IErrorRecordsImpl::GetCustomErrorObject

Returns a pointer to an interface on a custom error object.

Syntax

STDMETHOD(GetCustomErrorObject )(ULONG ulRecordNum,
   REFIID riid,
   IUnknown **ppObject);

Parameters

See IErrorRecords::GetCustomErrorObject in the OLE DB Programmer's Reference.

IErrorRecordsImpl::GetErrorInfo

Returns an IErrorInfo interface pointer on the specified record.

Syntax

STDMETHOD(GetErrorInfo )(ULONG ulRecordNum,
   LCID lcid,
   IErrorInfo **ppErrorInfo);

Parameters

See IErrorRecords::GetErrorInfo in the OLE DB Programmer's Reference.

IErrorRecordsImpl::GetErrorParameters

Returns the error parameters.

Syntax

STDMETHOD(GetErrorParameters )(ULONG ulRecordNum,
   DISPPARAMS *pdispparams);

Parameters

See IErrorRecords::GetErrorParameters in the OLE DB Programmer's Reference.

IErrorRecordsImpl::GetRecordCount

Returns the number of records in the OLE DB record object.

Syntax

STDMETHOD(GetRecordCount )(ULONG *pcRecords);

Parameters

See IErrorRecords::GetRecordCount in the OLE DB Programmer's Reference.

IErrorRecordsImpl::m_rgErrors

An array of error records.

Syntax

CAtlArray< RecordClass > m_rgErrors;

See also

OLE DB Provider Templates
OLE DB Provider Template Architecture