var SQLQuery1 : TSQLQuery; Trx1 : TSQLTransaction; SQLQuery1PHOTO: TBlobField; m: TStream;begin /*Create Components*/ Trx1 := TSQLTransaction.Create(nil); Trx1.DataBase := IBConnection1; SQLQuery1 := TSQLQuery.Create(nil); /*prepare param in runtime*/ SQLQuery1PHOTO := TBlobField.Create(nil); SQLQuery1PHOTO.DataSet := SQLQuery1; SQLQuery1PHOTO.FieldName := 'PHOTO'; SQLQuery1PHOTO.Size := 8; /*Assign transaction*/ SQLQuery1.Transaction := Trx1; /*Add query*/ SQLQuery1.SQL.Add(Format('Select PHOTO from employee where emp_no = %0:s',[Edit1.Text])); /*Active Query*/ SQLQuery1.Active := True; /*Validate Blob */ if SQLQuery1PHOTO.IsNull then Image1.Picture:= nil else begin /*Display picture*/ Image1.Picture.Graphic:= TJpegImage.Create; m:= SQLQuery1.CreateBlobStream(SQLQuery1PHOTO, bmRead); Image1.Picture.Graphic.LoadFromStream(m); SQLQuery1PHOTO.Free; m.Free; end; /*Commit transaction*/ Trx1.Commit; /*Free variables*/ SQLQuery1.Free; Trx1.Free;