Help with copying database programatically.

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
 
T

Tim Ferguson

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
 
K

Karim Devinishall

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top