TransferDataBase won't work

R

Robbo

DoCmd.TransferDatabase acExport, "dBase III", CurrentDb.Name, acTable,
"tblTempOutput", "C:\Out.dbf"

Can anyone tell me if there is something wrong with the above code because
at this stage I am thinking I will need to reload MS Access. When I run it
from a Sub in a module I get a message to say that says:
"C:\Documents and Settings\Rob\My Documents\MyDatabase.accdb is not a valid
path. Make sure that the path name is spelled correctly and that you are
connected to the server on which the file resides."

If I try to create the database using the MS Access menu paths it works fine.

I have tried changing CurrentDb.Name in the code with the fully qualified
name and the same thing happens.

I tried changing the formal from "DBase III" to "Microsoft Access" and,
whether I use the output path of "C:\Out.dbf" or "C:\Out.mdb" or
"C:\Out.accdb" it tells me that the output doesn't comply with Microsoft
naming conventions.

I have also checked that the name I am using ("tblTempOutput") is correctly
spelled (I copy and pasted the name to make sure)
 
K

kc-mass

Try This:
DoCmd.TransferDatabase acExport, "dBase III", C:\,, "tblTempOutput",
"Out.dbf"

Regards

Kevin
 
R

Robbo

Hi Kevin,

That did it, Thank you very much.

However it seems to go against what the help says. The definition in the
help is as follows whereas the solution suggests that the DatabaseName should
be the Path where I want the new database to be saved and and the Destination
is just the name I want to give it. That's confusing!

expression.TransferDatabase(TransferType, DatabaseType, DatabaseName,
ObjectType, Source, Destination, StructureOnly, StoreLogin)
--
Cheers
Rob


kc-mass said:
Try This:
DoCmd.TransferDatabase acExport, "dBase III", C:\,, "tblTempOutput",
"Out.dbf"

Regards

Kevin
 
K

kc-mass

You are right it is confusing/fogged.

Good Luck

Kevin

Robbo said:
Hi Kevin,

That did it, Thank you very much.

However it seems to go against what the help says. The definition in the
help is as follows whereas the solution suggests that the DatabaseName
should
be the Path where I want the new database to be saved and and the
Destination
is just the name I want to give it. That's confusing!

expression.TransferDatabase(TransferType, DatabaseType, DatabaseName,
ObjectType, Source, Destination, StructureOnly, StoreLogin)
 

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