Board index » delphi » TMemo -> Database Memo Field

TMemo -> Database Memo Field

Does anybody know of an easy way to copy the contents of a TMemo
component into a Memo field of a Paradox table?

It seems like it should be really easy but I can't find out how in any
of the help files or Delphi manuals...

Thanks in advance...

--
========================================================
          John Baumbach  man...@vcnet.com
Custom Components: TMovingButton and ScrollingBackground
 Available for free at -=>  http://www.vcnet.com/mantis
   Plus Delphi FAQ, some humor, sample apps and more!
========================================================

 

Re:TMemo -> Database Memo Field


In article <32AE0A33.3...@ibnlsource.com>, man...@ibnlsource.com
says...

Quote

>Does anybody know of an easy way to copy the contents of a TMemo
>component into a Memo field of a Paradox table?

If you want to copy just one memo (just to get the data across) then
a simple cut (ctrl-c) and paste (ctrl-v) would do the trick.

To achieve the same thing in a program :

a simple Delphi program reading/writing the Lines property of the memo

for i := 0 to Memo.Lines.Count-1 do
   DBMemo.Lines.Add(Memo.Lines[i]);

where Memo is a TMemo and DBMemo is TDBMemo pointing to your
Paradox table, and memo field within the table.

Re:TMemo -> Database Memo Field


Assign data from table to Memo:

  TMemo1.Lines.Assign(TTable1.FieldByName('MemoField'));

To get the data from a memo to the table, you create a persistent field.
Select the Table component then right click.  Select fields editor.
Add the Memo field.  You may have to add all the fields from the table.

  Table1MemoField.Assign(TMemo1.Lines);  { Lines to Table Field }

John Baumbach <man...@ibnlsource.com> wrote in article
<32AE0A33.3...@ibnlsource.com>...

Quote
> Does anybody know of an easy way to copy the contents of a TMemo
> component into a Memo field of a Paradox table?

> ...

Other Threads