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 strongm 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 1 database to another

Status
Not open for further replies.

gransbpa

Programmer
Jun 5, 2001
98
NL
Hi there,

I want to copy table from one database to another with lines of code. I used the TransferDatabase method as well as the CopyObject method, but both create a link to the original database table instead of an actual copy. This is not what I want, however: I want the actual table copied. Anyone know how to do this? Any help will be greatly appreciated
 
The first arguement of the TransferDatabase method of the DoCmd object, is the TransferType (optional), so:

[tt]docmd.transferdatabase acimport, "Microsoft Access", c:\some.mdb", actable, "tablename","newtablename",false[/tt]

should copy the table tablename in some.mdb and call it newtablename in the current database (hit F1 on transferdatabase to read more - and perhaps consider a visit to the pure Access fora for Access related questions;-)).

Roy-Vidar
 
Thanks Roy, Frederico. I used the transferdatabase method exactly like that, and the problem was still that I got a linked table instead of a real copy. Now I found out why: the source database opened with workgroup file information, the destination database did not. I hope to bypass this problem somehow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top