save Contact Photo (bitmap) as Blob Field in DB

stefanoa

Active Member
Licensed User
Longtime User
hi,
i need to save a contact photo into a Blob field of a sqlite db.

this code don't work, because i think photo field has to be converted:
B4X:
Dim photo As Bitmap
...
dim c as Contact
...
photo = c.GetPhoto
...
sqlcmd = "UP DATE Contacts "
sqlcmd = sqlcmd & " SET image = " & photo    '<--- image is a BLOB field in DB
sqlcmd = sqlcmd & " WHERE LocalContactID = " & ContactID
...
SQL1.ExecNonQuery(sqlcmd)
...
any suggestions?
thanks
 

stefanoa

Active Member
Licensed User
Longtime User
thanks, but i need to store the bitmap in my DB (sqlite).
The table have a blob field (image) and i need to store the contact photo (bitmap) into this field..
 
Upvote 0
Top