Store rich text in database

Posted in Databases

For reading and writing data you can use BLOB stream feature of TTable:

procedure TForm1.Button2Click(Sender: TObject);
var
  Stream1: TStream;
begin
  Table1.Edit;
  Stream1:=Table1.CreateBlobStream(Table1.FieldByName('RTF'),bmReadWrite);
  RichEdit1.Lines.SaveToStream(Stream1);
  Table1.Post;
  RichEdit1.Clear;
end;