Board index » delphi » Copying tables in ADO

Copying tables in ADO

Hello,

I'm stuck with this problem,
Does anyone know how i can copy a table from one database to another, with
ado (both access DB's, the table doesn't exist in the second DB)

I know that you can use select ... into , but since i'm using 2 different
connections (2 MDB files) i don't know how i can do that.  And i really need
to do it in delphi.

Any help would be appreciated =)

 

Re:Copying tables in ADO


I suggest using TADOCommand to create the table in database 2.  You can then
use a couple of TADODataset components to copy a dataset from one database
to the other.  You might even be able to use one TADODataset and change its
TADOConnection.

I haven't done this, but I beleive it will work based on a few other things
I have tried.

Quote
Stijn Verrept wrote in message <9hhl5b$m7...@news.planetinternet.be>...
>Hello,

>I'm stuck with this problem,
>Does anyone know how i can copy a table from one database to another, with
>ado (both access DB's, the table doesn't exist in the second DB)

>I know that you can use select ... into , but since i'm using 2 different
>connections (2 MDB files) i don't know how i can do that.  And i really
need
>to do it in delphi.

>Any help would be appreciated =)

Re:Copying tables in ADO


How do i create it, the filling of records will be easy, but how do i create
an exact copy of the structure?

Quote
"William Orr" <william....@bbc.co.uk> wrote in message

news:9hhn0b$gn2$1@nntp0.reith.bbc.co.uk...
Quote
> I suggest using TADOCommand to create the table in database 2.  You can
then
> use a couple of TADODataset components to copy a dataset from one database
> to the other.  You might even be able to use one TADODataset and change
its
> TADOConnection.

> I haven't done this, but I beleive it will work based on a few other
things
> I have tried.

> Stijn Verrept wrote in message <9hhl5b$m7...@news.planetinternet.be>...
> >Hello,

> >I'm stuck with this problem,
> >Does anyone know how i can copy a table from one database to another,
with
> >ado (both access DB's, the table doesn't exist in the second DB)

> >I know that you can use select ... into , but since i'm using 2 different
> >connections (2 MDB files) i don't know how i can do that.  And i really
> need
> >to do it in delphi.

> >Any help would be appreciated =)

Re:Copying tables in ADO


Have you tried SQL ?

SELECT *  INTO Table1 IN "other.mdb"
FROM Table1

"Stijn Verrept" <sverr...@vub.ac.be> schreef in bericht
news:9hhl5b$m7n$1@news.planetinternet.be...

Quote
> Hello,

> I'm stuck with this problem,
> Does anyone know how i can copy a table from one database to another, with
> ado (both access DB's, the table doesn't exist in the second DB)

> I know that you can use select ... into , but since i'm using 2 different
> connections (2 MDB files) i don't know how i can do that.  And i really
need
> to do it in delphi.

> Any help would be appreciated =)

Re:Copying tables in ADO


GREAT :))  you made me a happy man, i didn't know you could do "c:\test.mdb"
in a query :)))

Thanks a lot.

Quote
"M.H. Avegaart" <avega...@NOSPAMmccomm.nl> wrote in message

news:9hk4c9$1821$1@scavenger.euro.net...
Quote
> Have you tried SQL ?

> SELECT *  INTO Table1 IN "other.mdb"
> FROM Table1

> "Stijn Verrept" <sverr...@vub.ac.be> schreef in bericht
> news:9hhl5b$m7n$1@news.planetinternet.be...
> > Hello,

> > I'm stuck with this problem,
> > Does anyone know how i can copy a table from one database to another,
with
> > ado (both access DB's, the table doesn't exist in the second DB)

> > I know that you can use select ... into , but since i'm using 2
different
> > connections (2 MDB files) i don't know how i can do that.  And i really
> need
> > to do it in delphi.

> > Any help would be appreciated =)

Other Threads