Export (0) Print
Expand All

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.

The following example demonstrates use of the CBulkRowset class.

// sample.cpp 
//

#include "stdafx.h"

class CTable1Data
{
   public:
   char m_szField1[50];

   BEGIN_COLUMN_MAP(CTable1Data)
     COLUMN_ENTRY(1, m_szField1)
   END_COLUMN_MAP()
};

int main(int argc, char* argv[])
{
   CoInitialize(NULL);

   CCommand<CAccessor<CTable1Data>, 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, "Select * from table1");
   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();

   return 0;
}

Header: atldbcli.h

Community Additions

ADD
Show:
© 2014 Microsoft