I am trying to insert a bitmap in a blob field, with no luck until now...
Tried
info : Type TPhoneContact (DisplayName As String, Phone As String, BmPicture As Bitmap)
Sub ImportContactToSureSms(Ct As TPhoneContact) As Boolean
Dim Om As OutputStream
Dim B() As Byte
Dim SQL As String
Om.InitializeToBytesArray(0)
Ct.BmPicture.WriteToStream(Om,100,"PNG")
B=Om.ToBytesArray
SQL="INSERT INTO Users(Key,DisplayName,Phone,Picture) VALUES("
SQL=SQL & "''," 'Key
SQL=SQL & "'" & Pure(Ct.DisplayName) & "'," 'DisplayNAme
SQL=SQL & "'" & Pure(Ct.Phone) & "'," 'Phone
SQL=SQL & Array As Object(B) & ")" 'Picture
Msgbox(SQL,"")
SqlDb.ExecNonQuery(SQL)
End Sub
But this throws an exception
android.database.sqlite.SQLiteException: unrecognized token: "[Ljava.lang.Object;@211c3a38)" (code 1): , while compiling: INSERT INTO Users(Key,DisplayName,Phone,Picture) VALUES('','Charlotte hername','[PhoneType=mobile, Number=012121212, IsInitialized=true
What am I doing wrong ?
Tried
info : Type TPhoneContact (DisplayName As String, Phone As String, BmPicture As Bitmap)
Sub ImportContactToSureSms(Ct As TPhoneContact) As Boolean
Dim Om As OutputStream
Dim B() As Byte
Dim SQL As String
Om.InitializeToBytesArray(0)
Ct.BmPicture.WriteToStream(Om,100,"PNG")
B=Om.ToBytesArray
SQL="INSERT INTO Users(Key,DisplayName,Phone,Picture) VALUES("
SQL=SQL & "''," 'Key
SQL=SQL & "'" & Pure(Ct.DisplayName) & "'," 'DisplayNAme
SQL=SQL & "'" & Pure(Ct.Phone) & "'," 'Phone
SQL=SQL & Array As Object(B) & ")" 'Picture
Msgbox(SQL,"")
SqlDb.ExecNonQuery(SQL)
End Sub
But this throws an exception
android.database.sqlite.SQLiteException: unrecognized token: "[Ljava.lang.Object;@211c3a38)" (code 1): , while compiling: INSERT INTO Users(Key,DisplayName,Phone,Picture) VALUES('','Charlotte hername','[PhoneType=mobile, Number=012121212, IsInitialized=true
What am I doing wrong ?