Board index » delphi » copy record table to table

copy record table to table

What is the best way to copy a record from one table to another table?
The second table has all the same fields except a few extra ones at the
end which I need to modify after I copy the record.
Thanks for any help.
John F.

 

Re:copy record table to table


John Freisen <jfrei...@netincom.com> wrote in article
<3471C803.6...@netincom.com>...

Quote
> What is the best way to copy a record from one table to another table?
> The second table has all the same fields except a few extra ones at the
> end which I need to modify after I copy the record.
> Thanks for any help.
> John F.

If the fields are in the same order, and assuming Table 1 has the 'short'
record,

For i:= 0 to Table1.FieldCount - 1 do
   Table2.Fields[i].Value := Table1.Fields[i].Value;

Table2.Post;
Table1.Next;

Connie

Other Threads