How to insert photos in BD Mysql with Firedac in Delphi?

1

I need to add images to DB, I do not know if I can use dbimage so I do not need to give insert and update and already pull directly into the record I'm working on.

I tried to use the tips from here , but I could not get it to work.

    
asked by anonymous 02.03.2017 / 21:00

1 answer

0

Good night, people I was able to insert do not know if it was the correct way ... I inserted an fdtable and set the datasource and name of the Table ...

var

jpg: Tjpegimage;

begin

if odfoto.Execute then

//  FDTable1.Open();

//  FDTable1.Edit;

 jpg := TJPEGImage.Create;

 FDTable1eq_foto.LoadFromFile(ODFoto.FileName);

 jpg.LoadFromFile(ODFoto.FileName);

 Image1.Picture.Assign(jpg);

 jpg.Free;

 end;

When 2clicks in image1 it opens the legal opendialog, in the save button I put fdtable.open and .edit

But now I can not pull the image, I have a dbgrid where I give 2 clicks and opens the registry to edit at that moment I would have to pull the image of the selected registry in image1, but I can not.

    
03.03.2017 / 01:10