Board index » delphi » How can i store a jpg into a blob field ?

How can i store a jpg into a blob field ?

Hi,

Use the TblobStream component and the savetostream method.

regards
Johnnie.

Quote
"" wrote:

 

Re:How can i store a jpg into a blob field ?


Quote
>"" wrote:

[ nothing ]

Try this:

 (Table1.FieldByName('pict') as TBlobField).LoadFromFile('c:\my.jpg');
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp5
Direct replies mailto:p...@augsburg.netsurf.de

Re:How can i store a jpg into a blob field ?


Use a TBlobStream and TJPEGImage.SaveToStream

something like this:

var
  BlobStream: TBlobStream;
begin
  BlobStream := DataSet.CreateBlobStream(Field, bmWrite);
  JPEGImage.SaveToStream(BlobStream);
  BlobStream.Free;
end;

/David

Other Threads