How to write and read pictures in Sqlite3 by TSQLite3Connection? lazarus / 16-Databases ---------------------------------------------------------------------- movedlazarus · 2011-06-02 03:02 How to write and read pictures in Sqlite3 by TSQLite3Connection?  self.SQLQuery1.Close;     self.SQLQuery1.SQL.Clear;     self.SQLTransaction1.StartTransaction;     self.SQLQuery1.SQL.Add('Insert into test (b,c) Values (:b,:c)');     self.SQLQuery1.Params.ParamByName('b').Value := 'aaaaa';     self.SQLQuery1.Params.ParamByName('c').LoadFromFile('c:/aaa.bmp',f tBlob);     self.SQLQuery1.ExecSQL;     self.SQLTransaction1.Commit;     self.SQLTransaction1.EndTransaction; the above code can run no errors. but how to read the aaa.bmp out and display it? ---------------------------------------------------------------------- Goodman H__ · 2011-07-01 05:44 Try this Code: [Select]procedure ReadImagFrmDB; var     fstream:TStream;     fpicture:TJpegImage; begin      if not(TBlobField(SqlQuery1.FieldByName('c')).IsNull) then      begin         fstream:=SqlQuery1.CreateBlobStream(SqlQuery1.FiledByName('c') ,bmRead);         try             fpicture.LoadFromStream(fstream);             DBImage1.Picture.Assign(fpicture);         finally            fstream.free;            fpicture.free;         end;      end; end;