Contents Index Close method GetStringChunk method

UltraLite for MobileVB User's Guide
  UltraLite for MobileVB API Reference
    ULResultSet class

GetByteChunk method


Prototype 

GetByteChunk ( _
   index As Integer, _
   src_offset As Long, _
   data As Long,  _
   data_len As Long, _
   filled_len As Long _
) As Boolean
Member of UltraLiteAFLib.ULResultSet

Description 

Fills the buffer passed in (which should be an array) with the binary data in the column. Suitable for BLOBS.

Parameters 

index    The 1-based ordinal of the column containing the binary data.

offset    The offset into the underlying array of bytes. The source offset must be greater than or equal to 0, otherwise a SQLE_INVALID_PARAMETER error will be raised. A buffer bigger than 64K is also permissible.

data    A pointer to an array of bytes. To get the pointer to the array of bytes, use the Visual Basic VarPtr() function.

data_len    The length of the buffer, or array. The data_len must be greater than or equal to 0.

filled_len    The number of bytes fetched. Because you don't know how big the BLOB data is in advance, you generally fetch it using a fixed-length chunk, one chunk at a time. The last chunk may be smaller than your chunk size. filled_len reports how many bytes were actually fetched.

Returns 

The number of bytes read.

Errors set 
Error Description
ulSQLE_CONVERSION_ERROR The error occurs if the column data type is not BINARY or LONG BINARY
ulSQLE_INVALID_PARAMETER The error occurs if the column data type is BINARY and the offset is not 0 or 1, or, the data length is less than 0.

The error also occurs if the column data type is LONG BINARY and the offset is less than 1.

Example 

In the following example, edata is a column name. If the data_len parameter passed in is not sufficiently long, the entire application will terminate.

Dim data (512) As Byte
...
table.Column("edata").GetByteChunk(0,data)

Contents Index Close method GetStringChunk method