Reputation: 2857
I have two access databases and would like to find a way to copy tables from one
database to the other. The copied table has to keep the same strucure and data.
I already tried to fiddle around with sqlBulkcopy but all information i can found about it
is using sqlBulkCopy to tranfer tables to sql server.
Can I use sqlBulkCopy to copy tables between mdb files or is there another way to do this ?
Upvotes: 1
Views: 3481
Reputation: 36451
You can import the whole table including keys and data from one Access database into the other by running this in the destination database:
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\Source_Database.mdb", acTable, "Source_Table", "Destination_Table"
Upvotes: 0
Reputation: 115857
Try this:
insert into [AccessTable]
select * from [MS Access;DATABASE=D:\My Documents\db2.mdb].[AccessTable2]
Upvotes: 3