Share via


CDaoRecordset::SetCacheStart

Call this member function to specify the bookmark of the first record in the recordset to be cached.

void SetCacheStart( 
   COleVariant varBookmark  
);

Parameters

  • varBookmark
    A COleVariant that specifies the bookmark of the first record in the recordset to be cached.

Remarks

You can use the bookmark value of any record for the varBookmark parameter of the SetCacheStart member function. Make the record you want to start the cache with the current record, establish a bookmark for that record using SetBookmark, and pass the bookmark value as the parameter for the SetCacheStart member function.

The Microsoft Jet database engine requests records within the cache range from the cache, and it requests records outside the cache range from the server.

Records retrieved from the cache do not reflect changes made concurrently to the source data by other users.

To force an update of all the cached data, pass the lSize parameter of SetCacheSize as 0, call SetCacheSize again with the size of the cache you originally requested, and then call the FillCache member function.

Note that if you are not creating a UNICODE recordset, the COleVariant object must be explicitly declared ANSI. This can be done by using the COleVariant::COleVariant( lpszSrc**,** vtSrc ) form of constructor with vtSrc set to VT_BSTRT (ANSI) or by using the COleVariant function SetString( lpszSrc**,** vtSrc ) with vtSrc set to VT_BSTRT.

For related information, see the topic CacheSize, CacheStart Properties" in DAO Help.

Requirements

Header: afxdao.h

See Also

Reference

CDaoRecordset Class

Hierarchy Chart

CDaoRecordset::FillCache

CDaoRecordset::GetCacheSize

CDaoRecordset::GetCacheStart

CDaoRecordset::SetCacheSize

Other Resources

CDaoRecordset Members