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 biv343 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 in an external DB

Status
Not open for further replies.

TheFitz

Programmer
Dec 18, 2003
140
GB
Hi all,

I've got a separate DB backend. I've got an empty blank table which I want to copy into a new table. I've been trying this (see below) from the front end but it isn't working as the front end has no link to the copy/source table:

Code:
DoCmd.CopyObject CurrentProject.Path & "\TEST_DT.MDB", "tblCompNew", acTable, "tblCompOrig"

Any ideas? I want the table to end up in the TEST_DB database with the source table.

Many thanks in advance,

Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!
 
Where is the blank table you wish to copy? The front end?


It is often a sign of problems in the design when this need to be done.

 
You may need to create the db then export the table into it
Code:
'SET REFERENCE TO DAO LIBRARY
Dim mydb As DAO.Database
Set mydb = DAO.CreateDatabase(CurrentProject.Path & "\testdb.mdb", dbLangGeneral)

But why you need to create a new db every time?

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Basically, I am trying to load about 18,000 records to 2 tables. These tables do not have a unique identifier, therefore I need to create one. I was using Access's Autonumber, however, I should be able to manually create a key field using a counter that I've got.

Thanks to Remou for pointing out my stupidity in trying to copy to recreate a table, instead of just dealing with it.



Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top