ONE Active Server Pages Product Home Page Developer Site Version


ADO Field Object GetChunk Method

Returns all or a portion of the contents of a large text or binary data Field object.

GetChunk Method Syntax (ADO Field Object)
variable = field.GetChunk( Size )
GetChunk Method Parameters (ADO Field Object)


Variant to hold data returned.


A Long expression equal to the number of bytes or characters you want to retrieve.

GetChunk Method Remarks (ADO Field Object)

Use the GetChunk method on a Field object to retrieve part or all of its long binary or character data. In situations where system memory is limited, you can use the GetChunk method to manipulate long values in portions rather than in their entirety.

The data a GetChunk call returns is assigned to variable. If Size is greater than the remaining data, the GetChunk method returns only the remaining data without padding variable with empty spaces. If the field is empty, the GetChunk method returns Null.

Each subsequent GetChunk call retrieves data starting from where the previous GetChunk call left off. However, if you are retrieving data from one field and then you set or read the value of another field in the current record, ADO assumes you are done retrieving data from the first field. If you call the GetChunk method on the first field again, ADO interprets the call as a new GetChunk operation and starts reading from the beginning of the data. Accessing fields in other ADO Recordset Object objects (that are not clones of the first Recordset object) will not disrupt GetChunk operations.

If the adFldLong bit in the ADO Field Object Attributes Property of a Field object is set to True, you can use the GetChunk method for that field.

If there is no current record when you use the GetChunk method on a Field object, error 3021 (no current record) occurs.

GetChunk Method Return Values (ADO Field Object)

Returns a Variant.

GetChunk Method Example (ADO Field Object)

See the ADO Field Object AppendChunk Method.