Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - AppForge Programming » Understanding UltraLite Development with AppForge » Working with data using the table API

Inserting, updating, and deleting rows Next Page

Working with BLOB data


You can fetch BLOB data for columns declared BINARY or LONG BINARY using the GetByteChunk method.

See GetByteChunk method.

Example

The following code demonstrates how to use the ULColumn.GetByteChunk method to get BLOB data.

'MobileVB using VB6
Dim table as ULTable
Dim col As ULColumn
Dim data(1 to 1024) As Byte
Dim data_fit As Boolean
Dim size As Long
Set table = Conn.GetTable("image")
table.Open
size = 1024
Set col = table.Column("img_data")
data_fit = col.GetByteChunk(VarPtr(data(1)), size)
If data_fit Then
  'No truncation
Else
  'data truncated at 1024
End if
table.Close
'Crossfire using vb.net
Dim table as ULTable
Dim col As ULColumn
Dim data(1 to 1024) As Byte
Dim data_fit As Boolean
Dim size As Long
Set table = Conn.GetTable("image")
table.Open
size = 1024
Set col = table.Column("img_data")
' The data argument must be a local variable
data_fit = col.GetByteChunk(data, size)
If data_fit Then
  'No truncation
Else
  'data truncated at 1024
End if
table.Close