แก้ไข

แชร์ผ่าน


CAccessorRowset Class

Encapsulates a rowset and its associated accessors in a single class.

Syntax

template <class TAccessor = CNoAccessor,
   template <typename T> class TRowset = CRowset>
class CAccessorRowset : public TAccessor, public TRowset<TAccessor>

Parameters

TAccessor
An accessor class.

TRowset
A rowset class.

Requirements

Header: atldbcli.h

Members

Methods

Name Description
Bind Creates bindings (used when bBind is specified as false in CCommand::Open).
CAccessorRowset Constructor.
Close Closes the rowset and any accessors.
FreeRecordMemory Frees any columns in the current record that need to be freed.
GetColumnInfo Implements IColumnsInfo::GetColumnInfo.

Remarks

Class TAccessor manages the accessor. Class TRowset manages the rowset.

CAccessorRowset::Bind

Creates the bindings if you specified bBind as false in CCommand::Open.

Syntax

HRESULT Bind();

Return Value

A standard HRESULT.

CAccessorRowset::CAccessorRowset

Initializes the CAccessorRowset object.

Syntax

CAccessorRowset();

CAccessorRowset::Close

Releases any active accessors and the rowset.

Syntax

void Close();

Remarks

Releases any associated memory.

CAccessorRowset::FreeRecordMemory

Frees any columns in the current record that need to be freed.

Syntax

void FreeRecordMemory();

CAccessorRowset::GetColumnInfo

Gets column information from the opened rowset.

Syntax

HRESULT GetColumnInfo(DBORDINAL* pulColumns,
   DBCOLUMNINFO** ppColumnInfo,
   LPOLESTR* ppStrings) const;

HRESULT GetColumnInfo(DBORDINAL* pColumns,
   DBCOLUMNINFO** ppColumnInfo);

Parameters

See IColumnsInfo::GetColumnInfo in the OLE DB Programmer's Reference.

Return Value

A standard HRESULT.

Remarks

The user must free the returned column information and string buffer. Use the second version of this method when you use CDynamicAccessor and need to override the bindings.

For more information, see IColumnsInfo::GetColumnInfo in the OLE DB Programmer's Reference.

See also

OLE DB Consumer Templates
OLE DB Consumer Templates Reference