DoCmd.TransferDatabase

G

Guest

I'm using this statement where ST and DT are String variables holding the
name of my Source and Destination tables respectively :-

DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\Destinationdb.mdb",
acTable, ST, DT

It works fine but if I run it again it also works fine which I find
suprising. I would expect Access to either fail due to the desination table
already existing or create the desination table with a suffix of 1 (to cater
for a table with the same name already being present).

The actual result of running the command twice is that the destination
database ends up with just one version of the correctly named table - is this
what you would expect?
 
P

Phred Bear

Andy said:
I'm using this statement where ST and DT are String variables holding the
name of my Source and Destination tables respectively :-

DoCmd.TransferDatabase acExport, "Microsoft Access",
"c:\Destinationdb.mdb",
acTable, ST, DT

It works fine but if I run it again it also works fine which I find
suprising. I would expect Access to either fail due to the desination
table
already existing or create the desination table with a suffix of 1 (to
cater
for a table with the same name already being present).

The actual result of running the command twice is that the destination
database ends up with just one version of the correctly named table - is
this
what you would expect?

Andy,

If you look in the "TransferDatabase Action" in the help file it says in the
'Destination' argument that it overwrites an existing file. You will need to
copy your original to another name.

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top