storage image in mysql

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lawrencetse
Posts: 1
Joined: Thu 31 May 2018 02:14

storage image in mysql

Post by lawrencetse » Thu 31 May 2018 02:27

Dear all,

Just try to switch the database from MSSQL to Mysql. everything works fine except image fields.
In MSSQL, field is defined as image, the save & read is fine.

but in MYSql, I changed the field type as blob, but it got error when I type to save the record
#42000You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '??眙煠:`#??5?......' at line 3

var Stream2:TStream;
var lUniImage: TUniDBImage;
begin
lUniImage:=TUniDBImage.Create(self);
lUniImage.Picture.LoadFromFile(AStream.FileName);
dsDetails.DataSet.Edit;

TBlobField(dsDetails.DataSet.FieldByName('Picture')).LoadFromStream(AStream);

Stream2:=dsDetails.DataSet.CreateBlobStream(dsDetails.DataSet.FieldByName('Picture'),bmwrite);
dsDetails.DataSet.Post;



Vesrion 7.2.6 for RAD studio 10.2

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: storage image in mysql

Post by ViktorV » Thu 31 May 2018 13:06

Unfortunately, we cannot reproduce the issue on the latest version MyDAC 9.1.5.
Please check whether the problem occurs on the latest version MyDAC 9.1.5 and if yes, to investigate the specified MyDAC behavior, please compose a full sample demonstrating the issue and send it to us using the contact form https://www.devart.com/company/contactform.html including the scripts for creating database objects. Also specify the exact MySQL (MariaDB) version.

Post Reply