CdbField::GetChunk Method

Returns all or a portion of the contents of a Memo or Long Binary (OLE Object) Field object in the Fields collection of a Recordset object.

Syntax

COleVariantGetChunk(LONG lOffset, LONG lBytes);

Parameters

Type Example Description
LONG lOffset A numeric expression that is the number of bytes to skip before copying begins.
LONG lBytes A numeric expression that is the number of bytes you want to return.

Remarks

GetChunk returns COleVariant whose type is set to the type of the accessed field.

Usage

#include <afxole.h>
#include <dbdao.h>

CdbRecordset      rs;
CdbField         fld;
COleVariant      vVal;
...                           // Initialize recordset, etc.
fld = rs.Fields[0];            // Get a field. (Assume it's a 35-byte long string)
vVal = fld.GetChunk(5L, 25L);     // Skip 5 bytes, get the next 25 bytes.