Page 1 of 1

[SOLVED] Access violation Updating a Blob

Posted: 10.10.2016, 12:43
by tintinux
Hi

Using ZeosLib 7.2.1-rc with Lazarus 1.6, I have an access violation when I execute the UPDATE Query in the code below. Image is a TImage remaining empty. The field Test is a Blob.

Code: Select all

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;    
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)

Best regards

Re: Access violation Updating a Blob

Posted: 13.01.2017, 18:40
by tintinux
Hi

Is there any news about this issue ?

I'm unable to understand what is wrong and to find if it is specific to one environment.
I could now make a test with Delphi 2007, but may be this will not be very helpful....

Do you need more informations ?

Best regards

Re: Access violation Updating a Blob

Posted: 15.01.2017, 23:55
by marsupilami
Hello tintinux,

nobody had the time yet to look into that bug. I will have a look after I fixed the bug, that I am working on currently. Creating a ticket on sourceforge will help us to not forget your bug reports. : o )

With best regards,

Jan

Re: Access violation Updating a Blob

Posted: 22.02.2017, 08:26
by tintinux
As specified in the SF ticket, this is now solved.
Thanks again.