Edit

Share via


CArrayRowset Class

Accesses elements of a rowset using array syntax.

Syntax

template < class TAccessor >
class CArrayRowset :
   public CVirtualBuffer <TAccessor>,
   protected CBulkRowset <TAccessor>

Parameters

TAccessor
The type of accessor class that you want the rowset to use.

Requirements

Header: atldbcli.h

Members

Methods

Name Description
CArrayRowset Constructor.
Snapshot Reads the entire rowset into memory.

Operators

Name Description
operator[] Accesses an element of the rowset.

Data Members

Name Description
CArrayRowset::m_nRowsRead The number of rows already read.

CArrayRowset::CArrayRowset

Creates a new CArrayRowset object.

Syntax

CArrayRowset(int nMax = 100000);

Parameters

nMax
[in] Maximum number of rows in the rowset.

CArrayRowset::Snapshot

Reads the entire rowset into memory, creating an image or snapshot of it.

Syntax

HRESULT Snapshot() throw();

CArrayRowset::operator

Provides array-like syntax for accessing a row in the rowset.

Syntax

TAccessor & operator[](int nrow);

Parameters

TAccessor
A templated parameter that specifies the type of accessor stored in the rowset.

nRow
[in] Number of the row (array element) you want to access.

Return Value

The contents of the requested row.

Remarks

If nRow exceeds the number of rows in the rowset, an exception is thrown.

CArrayRowset::m_nRowsRead

Contains the number of rows in the rowset that have already been read.

Syntax

ULONG m_nRowsRead;

See also

OLE DB Consumer Templates
OLE DB Consumer Templates Reference
CRowset Class