Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying a table from one backend database to another 1

Status
Not open for further replies.

nickperez22

Technical User
Jun 13, 2001
62
US
I need to copy a table from one backend database (Source) to another (Destination) from my frontend. I tried using CopyObject but it only allows me to set the destination database and not the source database.

Since the table that I'm copying is a linked table to the front end when I ran the code all it did was put a link in the destination database to the source database instead of actually copying the table.

I could import the table from the backend and then use the CopyObject to put it into the destination database but was wondering if there was a better solution.
 
As Source table is linked into your current front end, how about :-

DoCmd.RunSQL "SELECT * INTO tblDestinationTableName " _
& "IN 'C:\Path\DestinationDbName.mdb' " _
& "FROM tblSourceTableName;"





G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Thanks littlesmudge that worked pretty good. I'm always amazed by how many smart people are out there. Have a nice day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top