Copy field

Hi
i'm developping a project with delphi 7 and  I need to copy some fields from one table in paradox 9 to another table in paradox 9 .
Somebody help me please .
Celina SisiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sinisa VukSoftware architectCommented:
Example depends on what you do - insert new record in second table or do edit...
Here is example of inserting new record. You must have two connection components - each to one for different paradox version.
Add two table component attach one to first connection component, second to second conn. comp.
...
Table2.Append;
Table1.Open;
Table2.FieldByName('Field1').AsInteger := Table1.FieldByName('Field8').AsInteger;
Table2.FieldByName('Field2').AsString := Table1.FieldByName('Field3').AsString;
Table2.Post;
...

Open in new window

0
Celina SisiAuthor Commented:
thanks
i want exactly copy the same data in one field from the first table to the second table
0
Sinisa VukSoftware architectCommented:
What do you think "exact" data? If field1 in Table 1 is "A" - then this value "A" is assign to field1 in Table2 - as is.
0
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Celina SisiAuthor Commented:
yes exactly like that
0
Sinisa VukSoftware architectCommented:
...then my example works... have you try it?
0
Celina SisiAuthor Commented:
i will try and i will tell you
thanks
0
Geert GOracle dbaCommented:
Records and columns ...
you need to position the 2nd table according to the primary key of the first table

var f: TField;
  I: Integer;

if table2.Locate('ID', table1.FieldByName('ID').Value, []) then 
begin
  for i := 0 to table2.FieldCount-1 do 
  begin
    f := table1.FindField(table2.Fields[I].FieldName);
    if f <> nil then 
      table2.Fields[I].Value := f.Value;
  end;
end;

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Geert GOracle dbaCommented:
why are you using Paradox in this Millenium ?
Paradox is from days long gone.
0
Celina SisiAuthor Commented:
you are right but i prefere it
0
Geert GOracle dbaCommented:
you prefer Paradox ?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.