GetChunk Method

See AlsolanGetChunkSee                 ExamplelanGetChunkEx>Low

Description

Returns all or a portion of a Memo or Long Binary field in a specified recordset22S7WAF.

Syntax

stringvar = fieldobject.GetChunk( offset, numbytes )

Remarks

The GetChunk method uses these parts:

Part                 Description

 

stringvar           A variable of type String or Variant8PHEAW3 that will receive the data from the field named by fieldobject.

fieldobject         A field of Memo or Long Binary type (not valid on fields of other field data types).  It can be a member of the Fields collection in a recordset.  In the Professional Edition, can also be an object variableZ3R9Q5 identifying a Field in a recordset.

offset                Numeric expression71RISN for the number of bytes to skip before copying begins.

numbytes         Numeric expression for the number of bytes you want to return.

 

GetChunk allows you to manipulate pieces of data, which conserves memory when working with fields larger than 64K.

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

If numbytes is larger than about 64K, an error occurs.  After assigning the results of GetChunk to a string variable, you can use the Len function to determine the number of bytes returned.  If numbytes is larger than the number of bytes in the field, only the actual number of bytes of data in the field are returned.  If numbytes is negative, an error occurs.

In Microsoft Access, the Long Binary field data type is called an OLE Object field data type.