Hi,
I upgraded SDAC from version 6 to last version 7. Now when reading blob-data through a TMSQuery with Options.CompressBlobMode set to cbNone where the stored data has been written with CompressBlobMode set to cbServer, accessing the data (ex. SaveToFile ..) an exception is raized. With previous version 6 this worked just fine without exception.
best regards
Toni Santa
SABE SOFT
			
									
									
						problem with Options.CompressBlobMode
Re: problem with Options.CompressBlobMode
Hi,
could be, my request was not very clear. Below a few lines of code to reproduce the actually behavior with compressed blobs. With last version 7 writing a blobfield with CompressBlobMode set to cbServer and than reading it with property set to cbNone, the data is not uncompressed. Doing the same with previous version 6 of SDAC the returned blob-stream was uncompressed.
So in the below example the resulting newfile.pdf is not a valid pdf since it contains the compressed stream.
best regards
Toni
			
									
									
						could be, my request was not very clear. Below a few lines of code to reproduce the actually behavior with compressed blobs. With last version 7 writing a blobfield with CompressBlobMode set to cbServer and than reading it with property set to cbNone, the data is not uncompressed. Doing the same with previous version 6 of SDAC the returned blob-stream was uncompressed.
So in the below example the resulting newfile.pdf is not a valid pdf since it contains the compressed stream.
best regards
Toni
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
  MSConnection1.Connect;
  try
    MSConnection1.ExecSQL('create table test (ablob image)');
    MSQuery1.SQL.Text := 'select * from test';
    MSQuery1.Options.CompressBlobMode := cbServer;
    MSQuery1.Active := true;
    MSQuery1.Append;
    TBlobField( MSQuery1.FieldByName('ablob')).LoadFromFile('c:\temp\testfile.pdf');
    MSQuery1.Post;
    MSQuery1.Active := false;
    MSQuery1.Options.CompressBlobMode := cbNone;
    MSQuery1.Active := true;
    TBlobField( MSQuery1.FieldByName('ablob')).SaveToFile('c:\temp\newfile.pdf');
    MSQuery1.Active := false;
  finally
    MSConnection1.ExecSQL('drop table test');
  end;
end;
Re: problem with Options.CompressBlobMode
Hello,
Thank you for the sample. We have reproduce the issue and will investigate the reasons for such behavior.
			
									
									
						Thank you for the sample. We have reproduce the issue and will investigate the reasons for such behavior.
Re: problem with Options.CompressBlobMode
Hi,
will new update 7.3.11 fix this issue?
regards, Toni
			
									
									
						will new update 7.3.11 fix this issue?
regards, Toni
Re: problem with Options.CompressBlobMode
We've investigated this behavior, and found that, in earlier versions, even when CompressBlobMode = cbServer, the data were not compressed, so they could be read in any mode. Now the behavior is changed, the data are compressed correctly, so the data should be read from the server in the same mode as they were recorded.