Partager via


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.

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

See Also

Concepts

CBulkRowset Members

OLE DB Consumer Templates (C++)

OLE DB Consumer Templates Reference