Answers for "load richedit from mdb"

0

load richedit from mdb

//Get the data from the database as AnsiString
rtfString := sql.FieldByName('rtftext').AsAnsiString;

//Write the string into a stream
stream := TMemoryStream.Create;
stream.Clear;
stream.Write(PAnsiChar(rtfString)^, Length(rtfString));
stream.Position := 0;

//Load the stream into the RichEdit
RichEdit.PlainText := False;
RichEdit.Lines.LoadFromStream(stream);

stream.Free;
Posted by: Guest on May-20-2021

Browse Popular Code Answers by Language