Contents Index AppendStringChunk method GetStringChunk method

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

GetByteChunk method


Prototype 

GetByteChunk ( _
   offset As Long, _
   data As Long,  _
   data_len As Long, _
   filled_len As Long _
) As Boolean
Member of UltraLiteAFLib.ULColumn

Description 

Gets data from a TypeBinary or TypeLongBinary column.

Parameters 

offset    The offset into the underlying array of bytes. The source offset must be greater than or equal to 0, otherwise a ulSQLE_INVALID_PARAMETER error will be raised.

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    This is an OUT parameter. After the method is called, it indicates how many bytes were fetched with valid data. If the size of BLOB data is unknown in advance, it is fetched using a fixed-length chunk - one chunk at a time. The last chunk fetched can be smaller than chunk size, so filled_len informs how many bytes of valid data exist in the buffer.

Returns 

True if this column value contains more data

False if there is no more data for this column in the database.

Errors set 
Error Description
ulSQLE_CONVERSION_ERROR The error occurs if the column data type isn't 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 larger than the actually array size, a General Protection Fault occurs.

Dim filled As Long
Dim more_data As Boolean
Dim data (1 to 512) As Byte
more_data = table.Column("edata").GetByteChunk(0, _
VarPtr(data(1)), 512, filled)

Contents Index AppendStringChunk method GetStringChunk method