ADO GetChunk Method

Definition and Usage

The GetChunk method can return a variant value that contains all or part of the content of the large text or binary data in the Field object.

Use the GetChunk method of the Field object to retrieve part or all of the long binary or character data. In cases where system memory is limited, the GetChunk method can be used to operate on part rather than all Long values.

The data returned by the GetChunk call will be assigned to variable. If Size is greater than the remaining data, the GetChunk method will return only the remaining data without padding variable with spaces. If the field is empty, the GetChunk method will return a Null value.

Each subsequent GetChunk call will start retrieving data from where the last GetChunk call stopped. However, if data from a field in the current record is retrieved and then a value in another field is set or read, ADO considers that the retrieval of data from the first field has been completed. If the GetChunk method is called again on the first field, ADO interprets this call as a new GetChunk operation and reads from the beginning of the data. Accessing fields in other Recordset objects (not copies of the first Recordset object) will not interrupt the GetChunk operation.

If the adFldLong bit in the Attributes property of the Field object is set to True, the GetChunk method can be used for this field.

Note:If the Getchunk method of the Field object is used without a current record, error 3021 (no current record) will occur.

Note:The GetChunk method does not work on the Field object of the Record object. It does not perform any operation and will produce a runtime error.

Syntax

variable_name=field.GetChunk(size)
Parameter Description
size Long expression, equal to the number of bytes or characters to be retrieved.