423,850 Members | 1,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,850 IT Pros & Developers. It's quick & easy.

DoCmd.TransferText bug

Seth Schrock
Expert 2.5K+
P: 2,908
Has anyone else run into a situation where DoCmd.TransferText doesn't work when the .CSV file name has extra periods in it (i.e. "1102141908270.FE010.CSV")? If I import it with that name, I get the following error: The Microsoft Access database engine could not find the object '1102142003010.FE010.CSV'. Make sure the object exists and that you spell its name and the path name correctly. If '1102142003010.FE010.CSV' is not a local object, check your network connection or contact the server administrator. If I remove the first period, then it imports fine.

These files are downloaded from the Internet, so I have no control over the file names. Is there anything that I can do besides renaming the file using code?
4 Weeks Ago #1

✓ answered by NeoPa

Hi Seth.

As Twinny says, renaming seems to be a workable approach.

Find the error number for that problem and handle it in code either by :
  • Copy; Import; Delete.
  • Rename; Import; Rename back.

Share this Question
Share on Google+
8 Replies


twinnyfo
Expert Mod 2.5K+
P: 2,704
Seth,

My solution would be to rename the files using code. I haven’t experienced that exact problem, but have experienced other file name issues. So, if I know there “might” be an issue, I find my list of files, cycle through all of them, searching for rascally naming issues, correct them, and then use the file.

It is an additional step that may only apply to some of my files, but in the end, it prevents other hang ups in the code.

Hope that hepps!
3 Weeks Ago #2

NeoPa
Expert Mod 15k+
P: 31,121
Hi Seth.

As Twinny says, renaming seems to be a workable approach.

Find the error number for that problem and handle it in code either by :
  • Copy; Import; Delete.
  • Rename; Import; Rename back.
3 Weeks Ago #3

Seth Schrock
Expert 2.5K+
P: 2,908
I hadn't thought of the option to rename it back to the original name after I was done importing the file or of copying the file with a usable name and then deleting it. I think the later will be my choice as I can always fall back to the unchanged file if an error causes a failure before I can change it back.
3 Weeks Ago #4

Stevan Bias
100+
P: 200
Hi Seth,

Unfortunately this is a known bug in MS Access. Some of those little bugs are irritating, but at least this one has an easy work around.
3 Weeks Ago #5

Seth Schrock
Expert 2.5K+
P: 2,908
One would think that it would be an easy fix for Microsoft as well.
3 Weeks Ago #6

Stevan Bias
100+
P: 200
"one would think"

#microshaftwindblows
3 Weeks Ago #7

NeoPa
Expert Mod 15k+
P: 31,121
Bear in mind that a Rename is far quicker to execute on any large file. Also, I would say just as easy to recover from if it errors. You just have to make sure you rename it back regardless.

OTOH both methods work, so go with what suits you best.
3 Weeks Ago #8

Seth Schrock
Expert 2.5K+
P: 2,908
Usually, the files are very small (about 3KB), so I don't think that copying will be a problem, but that is a good consideration.
3 Weeks Ago #9

Post your reply

Sign in to post your reply or Sign up for a free account.