CBulkRowset Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at 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.

Methods

AddRefRowsIncrements the reference count.
CBulkRowsetConstructor.
MoveFirstRetrieves the first row of data, performing a new bulk fetch if necessary.
MoveLastMoves to the last row.
MoveNextRetrieves the next row of data.
MovePrevMoves to the previous row.
MoveToBookmarkFetches the row marked by a bookmark or the row at a specified offset from that bookmark.
MoveToRatioFetches rows starting from a fractional position in the rowset.
ReleaseRowsSets the current row (m_nCurrentRow) to zero and releases all rows.
SetRowsSets the number of row handles to be retrieved by one call.

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();
}

Header: atldbcli.h

OLE DB Consumer Templates
OLE DB Consumer Templates Reference

Show: