Using ZeosLib 7.2.1-rc with Lazarus 1.6.0, I have an access violation when I execute the UPDATE ZQuery (see the code below). Image is a TImage remaining empty. The field Test is a Blob. The error exists also with a non empty image.
There is no error with ZeosLib 7.1.4-stable.
I have attached a simple Lazarus program reproducing the issue, with a screen copy of the error message.
I don't know if it happens also with Delphi, but my code should be compatible after changing the extensions, (rename lpr in dpr, lfm in dfm).
I have only Delphi 2007 and it would require me some time to reinstall it... and maybe it is not very useful to try with such an old version.
Best regards
procedure PictureToParam(const aPicture: TPicture; const aParam: TParam); var Stream: TStream; begin Stream := TMemoryStream.Create; try aPicture.PixMap.SaveToStream(Stream); Stream.Position := 0; aParam.LoadFromStream(Stream, ftBlob); finally Stream.Free; end; end; procedure TForm1.BitBtn2Click(Sender: TObject); begin ZQuery.Sql.Text := 'UPDATE Testzeos SET Test := :Test ;' ; PictureToParam(Image.Picture, ZQuery.Params[0]); ZQuery.ExecSql; showmessage ('no error !'); end;
Diff:
Diff:
Diff:
Hi Tintinux,
hope i got it. Please update from SVN.
Commit done: 3956
Please close if OK.
Last edit: EgonHugeist 2017-02-20
Hi
Yes it works now with Lazarus 1.6.2.
Thanks.