Board index » delphi » Copying persistent fields from one Table to another

Copying persistent fields from one Table to another

I use DataModule, when all tables in my projects have persistent
fields defined.

In some forms, I use temporary Ttable, with the proposal of search
records, etc. In this temporary table, I would like to have the same
Tpersistent fields in the correspondent table in DataModule.

How, with few code, in runtime, to copy all the Tfields to this
Ttable? And, after close the temporary table, delete all the
persistent fields?

Thanks in advance.
Hercules.

Hrcules Russano
HRsft - "Simples, mas funciona"
S?o Gon?alo - RJ - Brasil

 

Re:Copying persistent fields from one Table to another


Why do you need persistent fields with a temporary table?  What do you need
to do that you cannot do with the automatically instantiated field objects?

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
 for any other reason remove nospam from my address.)

Re:Copying persistent fields from one Table to another


On Sat, 10 Apr 1999 15:39:59 -0700, "Bill Todd"

Quote
<b...@nospam.dbginc.com> wrote:

DELPHI 3.0 CS / Dbase Tables / BDE 4.0

I build a generic form (TFchoice), with a Ttable, a DBGrid and some
code to search records. In various forms in the project, when the user
press F1 in a DBedit with focus, automatically the generic form is
called, with the correspondent table. I can't use the table already
opened in DataModule, because I need to change IndexName, changing the
record pointer, etc

The caller sets in TFchoice,  in OnKewDown event of the DBedit, for
example:
    ...
   TFchoice.TableChoice.TableName := 'clients.dbf';
   TFchoice.TableChoice.IndexName := 'name';
   TFchoice.showmodal;

In this moment, I need that the TableChoice had  the same Tpersistent
fields that the table has in DataModule, like editMask, displayLabel,
lookUp fields, etc.

Thanks in advance.
...

Quote
>Why do you need persistent fields with a temporary table?  What do you need
>to do that you cannot do with the automatically instantiated field objects?

Hrcules Russano
HRsft - "Simples, mas funciona"
S?o Gon?alo - RJ - Brasil

Re:Copying persistent fields from one Table to another


This code copy only the information about underlying fields, not the
Tfields objects defined in the source table.

Hrcules Russano
HRsft - "Simples, mas funciona"
S?o Gon?alo - RJ - Brasil

Re:Copying persistent fields from one Table to another


I do not understand what you are trying to copy. Every dataset has a set of
field objects whether they are instantiated at design time using the Fields
Editor or created automatically at run time.

What are you trying to accomplish?

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
 for any other reason remove nospam from my address.)

Other Threads