Import a file with periods in the name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • river
    New Member
    • May 2010
    • 5

    #1

    Import a file with periods in the name

    I am building an application that will be importing selected files from a shared drive. The group uses periods in the names of these files. I don't think Access will recognize the file to even allow me to rename it? Asking this group to change their naming convention after years and years may be a difficult task. Is there another way to rename these files so that the database can import them?

    Any help would be greatly appreciated.
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    It.really.shoul d.be.no.problem .txt

    How are you picking these files? Are you using some method to search for them in a specific directory/sub directories.

    I just used notepad to create the above named file and use the Dir Function from Visual Basic 6.0 with no problems, and since you are using VBA, I don't see why you should not be able to do the same...



    Good Luck

    Comment

    • river
      New Member
      • May 2010
      • 5

      #3
      Originally posted by vb5prgrmr
      It.really.shoul d.be.no.problem .txt

      How are you picking these files? Are you using some method to search for them in a specific directory/sub directories.

      I just used notepad to create the above named file and use the Dir Function from Visual Basic 6.0 with no problems, and since you are using VBA, I don't see why you should not be able to do the same...



      Good Luck
      Thanks for the quick response. The application opens the file manager so the user can select the file to import. I solved it by finding a wonderful piece of code that strips out the periods from the file name. I set this new name as a variable, then use the FileCopy to copy the file they selected and save it under the new name. The application then imports the copy and deletes it once the task is complete. The user never knows that anything occurred! This will work no matter where they put the file or how many times the directory path changes.

      Is there any chance that you know how to create a progress bar while the records are being processed? This may take some time so we don't want the user to think the program stopped running. This will be my task today, to enable the user to see the progress.

      Thanks again for the help!

      Comment

      • vb5prgrmr
        Recognized Expert Contributor
        • Oct 2009
        • 305

        #4
        Well a progress bar will only be helpful to you if you are controlling the loading of data, say through a loop, but if you are using a command to import the records through access, you're out of luck. Then again, if access is doing the importing, it should have a progress bar in the status bar... I guess more information is needed for this to be answered correctly...



        Good Luck

        Comment

        • river
          New Member
          • May 2010
          • 5

          #5
          Originally posted by vb5prgrmr
          Well a progress bar will only be helpful to you if you are controlling the loading of data, say through a loop, but if you are using a command to import the records through access, you're out of luck. Then again, if access is doing the importing, it should have a progress bar in the status bar... I guess more information is needed for this to be answered correctly...



          Good Luck
          Should have put more info up. This application may be processing hundreds of thousands of recs and it can be a pretty slow job. I didn't need the progress bar for importing (about a sec to bring in the file and clean). I found a few good posts on the web as to how to build a progress bar that I will be trying out. I should be able to get one of them to work.

          Thanks again for being so quick to respond.

          Comment

          Working...