I am new to WPTools (purchased two days ago) very impressed thus far but have not been able to save a RTF document to a database field. Previously for another RTF component the following code worked. I've searched the Internet and this forum without success. Any help is much appreciated.
procedure TForm16.SaveToDBClick(Sender: TObject);
var
MS : TMemoryStream;
RichEdit : TRichEdit;
MyID:Integer;
begin
if EditorQuery.State = dsEdit then
begin
myid:=StrToInt(id.Text);
editor := TRichEdit.Create(Self);
MS := TMemoryStream.Create;
try
editor.Parent := Self;
editor.Visible := False;
TBlobField(EditorQuery.FieldByName('Narr')).SaveToStream(MS);
MS.Position := 0;
Editor.Lines.LoadFromStream(MS);
editor.Lines.LoadFromStream(MS);
Editor.DataSource:=EditorSource;
Editor.DataField:='Narr';
EditorQuery.Post;
finally
MS.Free;
RichEdit.Free;
end;
end;