TransferDatabase - Not a valid file name

J

Jeff Friedman

I am having difficulties

I have set a variable to specify the path to an external
access database to use in the transferdatabase method.
When I execute the method, I get an error name

Run-time error 3055
not a valid file name

It works if I hard code the full path and filename in the
method, but not with a variable.

-jeff
 
J

John Nurick

Hi Jeff,

This normally works just fine:

Dim strDBName as String

strDBName = "D:\Folder\Other folder\My File.mdb"
docmd.TransferDatabase acImport, _
"Microsoft Access", strDBName, _
blah, blah...

Are you certain that your code is assembling a valid filespec in the
variable? Check the value as you step through the code.

If that's not the problem, please post back with more information about
the circumstances including the version(s) of Access involved and the
*exact* error message.


I am having difficulties

I have set a variable to specify the path to an external
access database to use in the transferdatabase method.
When I execute the method, I get an error name

Run-time error 3055
not a valid file name

It works if I hard code the full path and filename in the
method, but not with a variable.

-jeff

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 

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