Board index » delphi » Save and recall formatted text in Memo field

Save and recall formatted text in Memo field

I have a database with a memo field, call it Memostuff.
When I load data from Memostuff into a RichText object,
it is no longer formatted. I have set the BlobType property
for Memostuff to ftFmtMemo. It still does not work.

My question is this:
How do you save formatted text in a memo field, and
then recall it to a richedit object?

I used the following statement to save the formatted data:
table1.FieldByName('Memostuff').asstring := richedit1.text;

I used the following statement to recall data:
richedit1.Lines.Add(table1.fieldbyname('Memostuff').asstring);

Any ideas?
Help would be greatly appreciated.
Sincerely,
Lauretta Carroll

 

Re:Save and recall formatted text in Memo field


Hello Lauretta,

Here is a sample:

RichEdit1.Lines.Assign(Table1.FieldByName('Memostuff'));

Table1.FieldByName('Memostuff').Assign(RichEdit1.Lines);

--
Andrei Fomine.
DbAltGrid allows multi-line layout and RTF text in a DBGrid descendant.
http://www.quasidata.com/

Quote
"Lauretta Carroll" <carr...@legacypress.com> wrote in message

news:3a3cba20_1@dnews...
Quote
> I have a database with a memo field, call it Memostuff.
> When I load data from Memostuff into a RichText object,
> it is no longer formatted. I have set the BlobType property
> for Memostuff to ftFmtMemo. It still does not work.

> My question is this:
> How do you save formatted text in a memo field, and
> then recall it to a richedit object?

> I used the following statement to save the formatted data:
> table1.FieldByName('Memostuff').asstring := richedit1.text;

> I used the following statement to recall data:
> richedit1.Lines.Add(table1.fieldbyname('Memostuff').asstring);

> Any ideas?
> Help would be greatly appreciated.
> Sincerely,
> Lauretta Carroll

Other Threads