Board index » delphi » Assigning String to a Memo Field

Assigning String to a Memo Field

What is the easiest way to assign a simple text string to a memo field?

I'm trying to use the syntax:
    MyTable.FieldByName('My Memo').AsString := 'Junk';
But, of course, I get the error "cannot access the field 'My Memo' as
'String',

So, how do I assign a simple string to a MemoField?

Thanks,
Jesse

 

Re:Assigning String to a Memo Field


try it with
   MyTable.FieldByName('My Memo').value := 'Junk';

Jesse Castleberry <D...@iThink.net> schrieb im Beitrag
<6inr83$qa...@news5.ispnews.com>...

Quote
> What is the easiest way to assign a simple text string to a memo field?

> I'm trying to use the syntax:
>     MyTable.FieldByName('My Memo').AsString := 'Junk';
> But, of course, I get the error "cannot access the field 'My Memo' as
> 'String',

> So, how do I assign a simple string to a MemoField?

> Thanks,
> Jesse

Re:Assigning String to a Memo Field


Quote
"Jesse Castleberry" <D...@iThink.net> wrote:
> What is the easiest way to assign a simple text string to a memo field?

Have you tried the following?

  MyMemo.Lines.Add('String');

Just took it out of the air, but it should work, as I know TMemo uses
Lines.

--
Tore Aursand - Norway - tor...@sn.no - http://home.sol.no/~toreau/
"How many of you believe in telekinesis? Raise MY hand!"

Other Threads