📜  将richedit 保存并加载到mdb - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:32.258000             🧑  作者: Mango

代码示例1
//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;