SQLiteBLOB

From Xojo Documentation

Revision as of 21:20, 2 February 2021 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 EndOfFile Read
EndOfFile Read Write

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