CRBase Class Overview

class CRBase : virtual public CPureBase

        CRBase, the core class of this module, is mainly used to retrieve records of a rowset. It provides functions to manage a rowset or an index object. Additionally, it lays a ground for updating a record with use of functions CRBase::SetData and CRBase::SetDataEx. It silently employs multiple accessors to manage a rowset efficiently, no matter how complex the rowset is.

        CRBase uses the batch mode (batch size =20 by default) to retrieve records for the best performance. Besides, CRBase provides the following ways to speed up navigating records.

  1. Use of just-in-need: The unique feature can dramatically improve accessing desktop databases such as MS Access, Excel, Paradox, dBase, and so on. It can accelerate accessing MS client cursor engine. It can also improve accessing network-based data sources somewhat. For the idea behind this feature, click here.

  2. Use of pointers to internal buffers: A caller can get pointers to buffers of the value, the length of the value in bytes, and the status for each of columns. The pointers themselves will not change as long as neither CRBase::SetDBPart or CRBase::SetDataType is called. Use of pointers to internal buffers can improve accessing a big rowset because it avoids traversing an array of DBBINDING structures. 

  3. Scrolling of records: CRBase provides the function CRBase::MoveNext(LONG nSkipped) to scroll records back and forward by setting a value for the parameter nSkipped without having to fetch records sequentially. 

  4. Reduction of coping data between a provider and a consumer: CRBase silently optimize accessors for reducing coping data between a provider and a consumer. CRBase will not let a provider set the length of fixed-length data types, but a caller can friendly retrieve the length of a fixed-length data type. A caller can use CRBase::SetDBPart to inform a provider what parts of data are needed at the run time for reduction of coping data between a provider and a consumer.

  5. Use of an independent bookmark accessor: CRBase will not let a provider copy a bookmark from a provider to a consumer for a record unless it is required. It avoids coping bookmark data from a provider to a consumer for each of records. 

        CRBase provides the two functions, CRBase::SetDataType and CRBase::SetDBPart, to configure the DBBINDING structure for each of columns at the run time. This feature adds a lot of flexibility to OleDBPro programming, and very useful for development of generic applications and components. It reduces the management of various complex data types and data types conversion as shown in the examples OleRead and DataShape. Additionally, CRBase provides the three functions, CRBase::GetLenStatus, CRBase::GetDataEx, CRBase::SetDataEx to friendly and flexibly retrieve and update various data with different data types.

        CRBase provides great methods to manage BLOBs no matter how many column BLOBs and what types of BLOBs a rowset has. This feature guarantees that CRBase can deal with any rowset, no matter how complex the rowset is. As shown in the example BLOBs, CRBase provides a series of functions to flexibly and friendly retrieve and update BLOBs with two ways, use of BLOBs as in-memory data and use of BLOBs as storage objects through interface ISequentialStream.

        CRBase lays a ground for managing chaptered records and use of OLEDB view object. As shown in the examples DataShape and FilterSort, CRBase makes use of various MS data services much simpler and more friendly. 

        CRBase has various functions to retrieve various properties and attributes for a rowset and each of its columns.

        It is notified that a user must pay attention to special data types. Otherwise, memory leaking may happen. However, a user will not meet this problem in most cases.

CRBase Class Members