description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CBulkRowset Class |
CBulkRowset Class |
11/04/2016 |
|
|
c6bde426-c543-4022-a98a-9519d9e2ae59 |
Fetches and manipulates rows to work on data in bulk by retrieving multiple row handles with a single call.
template <class TAccessor>
class CBulkRowset : public CRowset<TAccessor>
TAccessor
An accessor class.
Header: atldbcli.h
Name | Description |
---|---|
AddRefRows | Increments the reference count. |
CBulkRowset | Constructor. |
MoveFirst | Retrieves the first row of data, performing a new bulk fetch if necessary. |
MoveLast | Moves to the last row. |
MoveNext | Retrieves the next row of data. |
MovePrev | Moves to the previous row. |
MoveToBookmark | Fetches the row marked by a bookmark or the row at a specified offset from that bookmark. |
MoveToRatio | Fetches rows starting from a fractional position in the rowset. |
ReleaseRows | Sets the current row (m_nCurrentRow ) to zero and releases all rows. |
SetRows | Sets the number of row handles to be retrieved by one call. |
The following example demonstrates use of the CBulkRowset
class.
[!code-cppNVC_OLEDB_Consumer#1]
Calls IRowset::AddRefRows to increment the reference count for all rows currently retrieved from the bulk rowset.
HRESULT AddRefRows() throw();
A standard HRESULT.
Creates a new CBulkRowset
object and sets the default row count to 10.
CBulkRowset();
Retrieves the first row of data.
HRESULT MoveFirst() throw();
A standard HRESULT.
Moves to the last row.
HRESULT MoveLast() throw();
A standard HRESULT.
Retrieves the next row of data.
HRESULT MoveNext() throw();
A standard HRESULT. When the end of the rowset has been reached, returns DB_S_ENDOFROWSET.
Moves to the previous row.
HRESULT MovePrev() throw();
A standard HRESULT.
Fetches the row marked by a bookmark or the row at a specified offset (lSkip) from that bookmark.
HRESULT MoveToBookmark(const CBookmarkBase& bookmark,
DBCOUNTITEM lSkip = 0) throw();
bookmark
[in] A bookmark marking the location from which you want to fetch data.
lSkip
[in] The number count of rows from the bookmark to the target row. If lSkip is zero, the first row fetched is the bookmarked row. If lSkip is 1, the first row fetched is the row after the bookmarked row. If lSkip is -1, the first row fetched is the row before the bookmarked row.
See IRowset::GetData in the OLE DB Programmer's Reference.
Fetches rows starting from a fractional position in the rowset.
HRESULT MoveToRatio(DBCOUNTITEM nNumerator,
DBCOUNTITEM nDenominator)throw();
nNumerator
[in] The numerator used to determine the fractional position from which to fetch data.
nDenominator
[in] The denominator used to determine the fractional position from which to fetch data.
A standard HRESULT.
MoveToRatio
fetches the rows roughly according to the following formula:
(nNumerator * RowsetSize ) / nDenominator
Where RowsetSize
is the size of the rowset, measured in rows. The accuracy of this formula depends on the specific provider. For details, see IRowsetScroll::GetRowsAtRatio in the OLE DB Programmer's Reference.
Calls IRowset::ReleaseRows to decrement the reference count for all rows currently retrieved from the bulk rowset.
HRESULT ReleaseRows() throw();
A standard HRESULT.
Sets the number of row handles retrieved by each call.
void SetRows(DBROWCOUNT nRows) throw();
nRows
[in] The new size of the rowset (number of rows).
If you call this function, it must be before the rowset is opened.
OLE DB Consumer Templates
OLE DB Consumer Templates Reference