Board index » delphi » Storing Text in database Memo field

Storing Text in database Memo field

I have a problem storing text from a DbMemo component into a database
memo field when the text has been added ONLY by program.
The memo is cleared                   : EssayMemo.Clear;
Text is added in UnitName by  :EssayMemo.Lines.Add('Some text');
Terminated by                                :EssayMemo.Lines.Add('');
and                                               :EssayMemo.SetFocus;

Unless text is added at this point from the keyboard then
the storage command:      
          SampleEssay.Assign(EssayForm.EssayMemo.Lines);
fails with an error stating that the dbfield is not in Edit mode.
Can anyone explain this or give me a workaround for it?

 

Re:Storing Text in database Memo field


I'm not sure if this will work but try using the Table.edit method before
you start adding the information into your DBMemo, this should put the
Table into edit mode

--
RCJ

G B Fish <gbf...@globalnet.co.uk> wrote in article
<5134ac$...@news-feed2.globalnet.co.uk>...

Quote
> I have a problem storing text from a DbMemo component into a database
> memo field when the text has been added ONLY by program.
> The memo is cleared                   : EssayMemo.Clear;
> Text is added in UnitName by  :EssayMemo.Lines.Add('Some text');
> Terminated by                                :EssayMemo.Lines.Add('');
> and                                               :EssayMemo.SetFocus;

> Unless text is added at this point from the keyboard then
> the storage command:      
>           SampleEssay.Assign(EssayForm.EssayMemo.Lines);
> fails with an error stating that the dbfield is not in Edit mode.
> Can anyone explain this or give me a workaround for it?

Other Threads