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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Tables from another Database 1

Status
Not open for further replies.

briglass

Programmer
Dec 4, 2001
179
GB
I have 2 access database files, apple.mdb and banana.mdb.

I would like to know how (using SQL or ADO) to copy a table from within banana.mdb and paste it into apple.mdb from visual basic.

This would be really helpful!
 
Please Try the Following Query it works for you...


Dim Db1 As DAO.Database
Set Db1 = OpenDatabase("C:\apple.mdb")

Db1.Execute "Select * INTO [TableName] From [TableName] IN 'C:\banana.mdb'"

Thanks
Sreekanth
 
Pls try this.....


Dim cn as ADODB.Connection;

cn.open("apple.mdb")

sql = "SELECT oldTable.* INTO newTable IN 'banana.mdb' FROM oldTable"

cn.execute(sql);

 
Thanks! This is the one that ended up working for me:

Set Db1 = OpenDatabase("C:\apple.mdb")

Db1.Execute "Select * INTO [TableName] From [TableName] IN 'C:\banana.mdb'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top