>

GetChunk Method

Applies To

Field Object.

Description

Returns all or a portion of the contents of a Memo or an OLE Object Field object in the Fields collection of a Recordset object.

Syntax

stringvar = recordset ! field.GetChunk(offset, numbytes)

The GetChunk method syntax has these parts.

Part

Description

stringvar

The name of a String variable or Variant that receives the data from the Field object named by field.

recordset

A variable of an object data type that specifies the Recordset object containing the Fields collection.

field

The name of a Field object whose Type property is set to dbMemo (Memo) or dbLongBinary (OLE Object).

offset

A numeric expression that is the number of bytes to skip before copying begins.

numbytes

A numeric expression that is the number of bytes you want to return.


Remarks

Assign the bytes returned by GetChunk to stringvar. Use GetChunk to return a portion of the total data value at a time. You can use the AppendChunk method to reassemble the pieces.

If offset is 0, GetChunk begins copying from the first byte of the field.

If numbytes is greater than the number of bytes in the field, the actual number of bytes in the field is returned.

Note

Use a Memo-type field for human-readable textual data, and put binary data only in OLE-type fields. Doing otherwise will cause undesirable results.

See Also

AppendChunk Method, FieldSize Method, Type Property.

Specifics (Microsoft Access)

After assigning the results of the GetChunk method to a string variable, you can use the Visual Basic Len function to determine the number of characters in the string. Or you can use the LenB function to determine the number of bytes used to represent that string.

Example

See the AppendChunk method example.

Example (Microsoft Access)

See the AppendChunk method example (Microsoft Access).