SQLiteBLOB

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object)

Provides a way for you to incrementally read and write to BLOB columns in SQLite databases. (SQLiteDatabase).

Properties
Length fa-lock-32.png Position


Methods
Close Flush Write
EndOfFile Read

Notes

Implements Readable and Writeable interfaces.

Examples

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.EndOfFile
data = data + blob.Read(1000)
Wend
blob.Close
Var mb As MemoryBlock
mb = data
Var logoPic As Picture = Picture.FromData(mb)
Catch error As IOException
MessageBox("Error while reading BLOB: " + error.Message)
End Try
End If

See Also

SQLiteDatabase.CreateBlob, SQLiteDatabase.OpenBlob methods