DoCmd.TransferText bug

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    DoCmd.TransferText bug

    Has anyone else run into a situation where DoCmd.TransferT ext 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?
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    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!

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      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.

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        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.

        Comment

        • Brilstern
          New Member
          • Dec 2011
          • 208

          #5
          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.

          Comment

          • Seth Schrock
            Recognized Expert Specialist
            • Dec 2010
            • 2965

            #6
            One would think that it would be an easy fix for Microsoft as well.

            Comment

            • Brilstern
              New Member
              • Dec 2011
              • 208

              #7
              "one would think"

              #microshaftwind blows

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                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.

                Comment

                • Seth Schrock
                  Recognized Expert Specialist
                  • Dec 2010
                  • 2965

                  #9
                  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.

                  Comment

                  Working...