Board index » delphi » Copy a table to another table howto

Copy a table to another table howto

Can some one answere me two questions.

1 how can i copy a adottable into another adottable
2 How can i export a table into comma delimited text file.

this is using delphi 6

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

 

Re:Copy a table to another table howto


Have a look at the Batchmove component.

Quote
"ade" <adrian.tet...@ntlworld.com> wrote in message

news:onUS7.9205$pU3.1164600@news2-win.server.ntlworld.com...
Quote
> Can some one answere me two questions.

> 1 how can i copy a adottable into another adottable
> 2 How can i export a table into comma delimited text file.

> this is using delphi 6

> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

Re:Copy a table to another table howto


Check my SMExport and SMImport suites - these component will doo all what
you need and even more...:-)

--
With best regards, Mike Shkolnik
E-Mail: mshkol...@scalabium.com
        mshkol...@yahoo.com
WEB: http://www.scalabium.com

ade <adrian.tet...@ntlworld.com> D???
???Y??:onUS7.9205$pU3.1164...@news2-win.server.ntlworld.com...

Quote
> Can some one answere me two questions.

> 1 how can i copy a adottable into another adottable
> 2 How can i export a table into comma delimited text file.

> this is using delphi 6

> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

Re:Copy a table to another table howto


thanks theo but i cant get batchmove to work with adotable i am not using
bde at all because it seems that the user needs bde on the machine that the
app is running on. thanks for the reply though.
Quote
"Theo Vermeiren" <theo.vermei...@pandora.be> wrote in message

news:vU7T7.5158$Up1.951@afrodite.telenet-ops.be...

Quote
> Have a look at the Batchmove component.

> "ade" <adrian.tet...@ntlworld.com> wrote in message
> news:onUS7.9205$pU3.1164600@news2-win.server.ntlworld.com...
> > Can some one answere me two questions.

> > 1 how can i copy a adottable into another adottable
> > 2 How can i export a table into comma delimited text file.

> > this is using delphi 6

> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

Re:Copy a table to another table howto


thanks mike i have been to your site a fiew times i think the stuff on there
is great never really looked at it before, [ shame on me ]
Quote
"Mike Shkolnik" <mshkol...@yahoo.com> wrote in message

news:9vkqdd$vf2$1@news.lucky.net...

Quote
> Check my SMExport and SMImport suites - these component will doo all what
> you need and even more...:-)

> --
> With best regards, Mike Shkolnik
> E-Mail: mshkol...@scalabium.com
>         mshkol...@yahoo.com
> WEB: http://www.scalabium.com

> ade <adrian.tet...@ntlworld.com> D???
> ???Y??:onUS7.9205$pU3.1164...@news2-win.server.ntlworld.com...
> > Can some one answere me two questions.

> > 1 how can i copy a adottable into another adottable
> > 2 How can i export a table into comma delimited text file.

> > this is using delphi 6

> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

Re:Copy a table to another table howto


The easiest way to copy a table is by using SQL, e.g.

insert into Table2
select * from Table1

or (if the field layout isn't the same):

insert into Table2(FieldA, FieldB)
select Field1, Field2 from Table1

Some database types even support:

select *
into Table2
from Table1

Quote
"ade" <adrian.tet...@ntlworld.com> wrote in message

news:onUS7.9205$pU3.1164600@news2-win.server.ntlworld.com...
Quote
> Can some one answere me two questions.

> 1 how can i copy a adottable into another adottable
> 2 How can i export a table into comma delimited text file.

> this is using delphi 6

> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

Re:Copy a table to another table howto


Quote
"ade" <adrian.tet...@ntlworld.com> wrote in message

news:onUS7.9205$pU3.1164600@news2-win.server.ntlworld.com...

Quote
> Can some one answere me two questions.

> 1 how can i copy a adottable into another adottable

Since BatchMove only works with BDE, something like:

  // untested
  tab1.first;
  while not tab1.eof do
  begin
     tab2.insert;
     for i := 0 to tab1.FieldCount-1 do
        tab2.fields[i].value := tab1.fields[i].value;
     tab2.post;
     tab1.next;
  end;

Quote
> 2 How can i export a table into comma delimited text file.

  more or les the same way (fields[i].asstring)
Quote

> this is using delphi 6

> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01

Other Threads