Copy Blob(Picture) from SQLite to Mysql Blob Column

Hello guys,

I`m trying to transfer some pictures from a Blob column from a SQLite Database into the new MySQL Database Blob column but it seems that no matter what i do it still does not work properly and in the end i cannot see the picture in my app.

Any ideas ?

So far what i did the only way that i get something inside the MySQL Database is :


dim recSet As RecordSet    // this is the recordset that is fetching the data from the SQLite Database 
Dim rec As RecordSet

rec.blobColumn("ColumnName") = recSet.Field("picture").NativeValue

SQLServer.InsertRecord(TableName, rec)

So far here i get some weird data starting with PPIC but in the app when i look i cannot see the picture.

Any other ideas to do that in the proper way ?

Thanks

how do you display your picture ?

Well usually i use MBS for that

On Fetching side

Window.ImageWell1.image = binarystringtoPictureMBS(contentSet.field("pict").nativeValue)

and now i just tried to put it as

On Inserting side

rec.blobColumn("ColumnName") = pictureToBinaryStringMBS(recSet.IdxField(fieldIdx).PictureValue)

In order to hav same encoding and everything but it seems that with the changes in insert now i get nothing , empty column .

Have you made sure that the data is the same bit for bit?

Maybe some text encoding conversion corrupts the binary data?

You can query length of field in bytes from SQLite and check if the string you read has same length as well as the BLOB you write.

Hello Guys, recently i tried to copy the data from the sqlite to the mysql server but no luck , i managed to replace Christians method with direct code but unfortunately it does not work properly . maybe im doing it wrong , any help is welcomed.

So in both cases i have the pictures columns as Blob

In the RecordSet while i update the record i set it like

rsp.Field("pict").PictureValue = thumb where thumb is a picture and it gets saved, if i create a record i so same way i treat the Blob column as a pictureColumn rec.PictureColumn("pict") = pictureBuffer.resize(128, 128) is that correct ?
If i look into the database and i click on the record specially in mysql mode it shows me the picture which is good, but not in sqlite mode when i do this , it deletes the records and that`s it. so the question is field().PictureValue is available over all the databases or just on Mysql ?

Thanks