CBulkRowset Class
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>
Parameters
- TAccessor
An accessor class.
Members
Methods
Increments the reference count. |
|
Constructor. |
|
Retrieves the first row of data, performing a new bulk fetch if necessary. |
|
Moves to the last row. |
|
Retrieves the next row of data. |
|
Moves to the previous row. |
|
Fetches the row marked by a bookmark or the row at a specified offset from that bookmark. |
|
Fetches rows starting from a fractional position in the rowset. |
|
Sets the current row (m_nCurrentRow) to zero and releases all rows. |
|
Sets the number of row handles to be retrieved by one call. |
Example
The following example demonstrates use of the CBulkRowset class.
class CCustomerData
{
public:
char m_szField1[50];
BEGIN_COLUMN_MAP(CCustomerData)
COLUMN_ENTRY(1, m_szField1)
END_COLUMN_MAP()
};
void DoCBulkRowsetTest()
{
CoInitialize(NULL);
CCommand<CAccessor<CCustomerData>, CBulkRowset > cmd;
CDataSource ds;
// Open up data link dialogs to create a data source
ds.Open();
CSession session;
session.Open(ds);
// Could call SetRows() here if you want to fetch
// more than 10 HROWs at a time.
cmd.Open(session, L"Select * from customer");
cmd.MoveFirst();
// Note that the CBulkRowset by default fetched 10 HROWs at a time
// so that the MoveNext call will not have to make the GetNextRows
// call to get the second HROW because it has already been fetched
//by the MoveFirst() call above.
cmd.MoveNext();
cmd.Close();
session.Close();
ds.Close();
}
Requirements
Header: atldbcli.h