Board index » delphi » Copy data from string field to memo field

Copy data from string field to memo field

Hi all

Two questions from a newbie.
1) How do one copy data from a string field to a memo field in a table
(runtime)?..
     I know how to programatically run through the table and change the
value of
     a field for all records in that table. But if you can just help me with
the above
      question.

2) How do one display the data in a memo field in a DBGrid?.
     If there is data in a memo field, only the word <MEMO> is displayed on
the
     DBGrid.

Thank you.

 

Re:Copy data from string field to memo field


Quote
Koos Loots wrote:

> Hi all

The "TMemoStream" object is a good way to work with memo-fields.  Oddly
enough, last time I used one I found that I had to create and destroy it
for every single record.

There are some third-party grid objects that can display memos but what
is more commonly done is to have the user click on the item, then
display the value in a pop-up box or in a separate memo-field area on
the screen.  

Quote
> Two questions from a newbie.
> 1) How do one copy data from a string field to a memo field in a table
> (runtime)?..
>      I know how to programatically run through the table and change the
> value of
>      a field for all records in that table. But if you can just help me with
> the above
>       question.

> 2) How do one display the data in a memo field in a DBGrid?.
>      If there is data in a memo field, only the word <MEMO> is displayed on
> the
>      DBGrid.

> Thank you.

--
------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)
Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Re:Copy data from string field to memo field


1) Just use:

Table1.FieldByName('SomeMemoField').AsString :=
Table1.FieldByName('SomeStringField').AsString;

2) Look at the AutoDisplay property of the TDBMemo control.

"Koos Loots" <ko...@absa.co.za> schreef in bericht
news:396ec30c$0$229@helios.is.co.za...

Quote
> Hi all

> Two questions from a newbie.
> 1) How do one copy data from a string field to a memo field in a table
> (runtime)?..
>      I know how to programatically run through the table and change the
> value of
>      a field for all records in that table. But if you can just help me
with
> the above
>       question.

> 2) How do one display the data in a memo field in a DBGrid?.
>      If there is data in a memo field, only the word <MEMO> is displayed
on
> the
>      DBGrid.

> Thank you.

Other Threads