Udostępnij za pośrednictwem


CRecordset::SetRowsetSize

Specifies the number of records you wish to retrieve during a fetch.

virtual void SetRowsetSize(
   DWORD dwNewRowsetSize 
);

Parameters

  • dwNewRowsetSize
    The number of rows to retrieve during a given fetch.

Remarks

This virtual member function specifies how many rows you wish to retrieve during a single fetch when using bulk row fetching. To implement bulk row fetching, you must set the CRecordset::useMultiRowFetch option in the dwOptions parameter of the Open member function.

Note

Calling SetRowsetSize without implementing bulk row fetching will result in a failed assertion.

Call SetRowsetSize before calling Open to initially set the rowset size for the recordset. The default rowset size when implementing bulk row fetching is 25.

Note

Use caution when calling SetRowsetSize. If you are manually allocating storage for the data (as specified by the CRecordset::userAllocMultiRowBuffers option of the dwOptions parameter in Open), you should check whether you need to reallocate these storage buffers after you call SetRowsetSize, but before you perform any cursor navigation operation.

To obtain the current setting for the rowset size, call GetRowsetSize.

For more information about bulk row fetching, see the article Recordset: Fetching Records in Bulk (ODBC).

Requirements

Header: afxdb.h

See Also

Reference

CRecordset Class

Hierarchy Chart

CRecordset::Open

CRecordset::GetRowsetSize

CRecordset::CheckRowsetError

CRecordset::DoBulkFieldExchange

Other Resources

CRecordset Members