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!

How to copy a table from one database to another

Status
Not open for further replies.

Paladyr

Programmer
Apr 22, 2001
508
US
A little while ago, someone tried to help me out with this but it ended up not working. Here is the code:

Code:
Set tdfTable = dbMaster.CreateTableDef("customers")
  With tdfTable
  i = 0
  Do
    i = i + 1
  Loop Until dbMaster.TableDefs(i).Name = "customers"
  .Name = dbMaster.TableDefs(i).Name
  .Connect = ";DATABASE=C:\Backups\3.mdb"
  .SourceTableName = dbMaster.TableDefs(i).Name
  
  dbBackup.TableDefs.Append tdfTable
[\code]

I want to take the table from dbMaster and copy it to dbBackup.  The variable tdfTable has the table name in it when I put it in the watch window, but it doesn't have all the fields and data, which is why I don't think it is working.  Isn't there like a simple method that will copy all properties of a table to another?  Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top