Link to home
Start Free TrialLog in
Avatar of selas
selas

asked on

How to save picture to file without Tblobfield

now i'm using TBlobField(AdoQuery2.fieldbyname('picture')).SaveToFile('Temp.jpg');
it works with dbgrid
but i need to save jpg picture without db grid..

This not work:

AdoQuery2.SQL.Clear; AdoQuery2.SQL.Add('Select picture from klientai where id = '+ id +'');
AdoQuery2.Open;
if not Adoquery2.IsEmpty then  //is there a picture?
    begin
      AdoQuery2.SaveToFile('Temp.jpg');
      Image1.Picture.LoadFromFile('Temp.jpg');
    end
  else
    begin
      Image1.Picture.Bitmap.Assign(Nil);  //there is no Image
    end;
ASKER CERTIFIED SOLUTION
Avatar of geobul
geobul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial