[SOLVED]Firebird Blobs lazarus / 16-Databases ---------------------------------------------------------------------- braximo · 2011-05-04 01:12 Good Day Developers! I am having a hard time reading/writing images(files) to my firebird databases blob. I am currently using lazarus 09.30 and firebird 2.1.3. I used to do this with vb6 but i am having a hard time doing it with lazarus. Any ideas? ---------------------------------------------------------------------- fredycc · 2011-05-04 02:41 Hi braximo, check this piece of code for reading blob, I hope will be useful: Quotevar   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; ---------------------------------------------------------------------- braximo · 2011-05-04 03:04 Thanks for the reply! Any idea about this: "identifier not found "TBlobField" ---------------------------------------------------------------------- braximo · 2011-05-04 04:08 Sorry about the identifier problem, I forgot to place DB in my uses. Try to study the code. If you have any other solutions, please help. ---------------------------------------------------------------------- braximo · 2011-05-05 02:43 Could anyone teach me how to write files in blob fields? thanks! ---------------------------------------------------------------------- braximo · 2011-05-06 09:23 Forget It Guys, I found the solution. Thanks anyway.