Help with copying database programatically.

  • Thread starter Thread starter Karim Devinishall
  • Start date Start date
K

Karim Devinishall

I am trying to write a piece of code to copy tables from an
odbc connection (mysql) into an access table. I can create
blank tables in the source database using ADOX, but I don't
understand how to populate the structure and data in the
tables from the source ado database.

To make life slightly more complicated, I'm using an
intermediate mdb file to copy from the source database to
the destination database.

After I've created these tables, I need to drop a couple of
fields, and then import forms, queries and a macro into the
destination database from the current mdb file. I think I
can do that by using the docmd.transferdatabase method.

Thanks in anticipation for any help.

Karim
 
I am trying to write a piece of code to copy tables from an
odbc connection (mysql) into an access table.

You can run it from the mdb file:


SELECT *
INTO NewTable
FROM OldTable IN [connectionstring=Look this up;]


or from the odbc database (i.e. an adp etc.)

SELECT *
INTO NewTable IN [c:\mynewmdb\MyNew.mdb]
FROM OldTable

Hope that helps


Tim F
 
Scrap that. Docmd.transferdatabase, with some ADOX stuff
to get the data beaten into shape properly did the job.
 
Back
Top