SQLiteBLOB.Read

From Xojo Documentation

Method

SQLiteBlob.Read(Count As Integer, encoding As TextEncoding = Nil) As String

Supported for all project types and targets.

Fetches Count bytes from the BLOB at the current read position. When reading text, you should specify the encoding.

Example

This example reads the Logo (stored as a binary picture) from the Logo column for rowID = 1 in the Team table:

Var blob As SQLiteBlob
blob = db.OpenBlob("Team", "Logo", 1, True)
If blob <> Nil Then
Try
Var data As String
While Not blob.EndOfData
data = data + blob.Read(1000)
Wend
blob.Close
// Do something with the data
Catch error As IOException
MsgBox("Error while reading BLOB: " + error.Message
End Try
End If

See Also

SQLiteDatabase, SQLiteDatabase.OpenBlob