By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

TransferDatabase passing variables

P: n/a
Hi,
I have a question about TransferDatabase. I am using the following
code, that works great:

strDBFPath = "\\servername\folder"
strDBFFile = "Master"

DoCmd.TransferDatabase acImport, "dBase IV", strDBFPath, acTable,
strDBFFile, "tblMfgImport", False

However, I would like to append today's date to strDBFFile variable,
since that is how the files are saved on the server. So I changed
strDBFFile to the following variations:

strDBFFile = "Master" & Format(Now(), "mmddyyyy")
strDBFFile = "Master" & CStr(Format(Now(), "mmddyyyy"))

Using the immediate window, I can see these return the correct
filename, but then it gives me a run-time error 3011, indicating that
it cannot find the file specified.
When I click on Debug, and mouseover strDBFFile, the file name shows as
what it should be.

Why cant it find the file? Any ideas?

Thanks,
Puneet.

Aug 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 24 Aug 2006 10:09:00 -0700, ac*******@gmail.com wrote:

The DBase driver only accepts 8.3 filenames, and the extension must be
..dbf

-Tom.

>Hi,
I have a question about TransferDatabase. I am using the following
code, that works great:

strDBFPath = "\\servername\folder"
strDBFFile = "Master"

DoCmd.TransferDatabase acImport, "dBase IV", strDBFPath, acTable,
strDBFFile, "tblMfgImport", False

However, I would like to append today's date to strDBFFile variable,
since that is how the files are saved on the server. So I changed
strDBFFile to the following variations:

strDBFFile = "Master" & Format(Now(), "mmddyyyy")
strDBFFile = "Master" & CStr(Format(Now(), "mmddyyyy"))

Using the immediate window, I can see these return the correct
filename, but then it gives me a run-time error 3011, indicating that
it cannot find the file specified.
When I click on Debug, and mouseover strDBFFile, the file name shows as
what it should be.

Why cant it find the file? Any ideas?

Thanks,
Puneet.
Aug 25 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.