"Importing TEXT file" to Access | Issue - Long file name (1 Viewer)

Ramya_mudambi

Registered User.
Local time
Today, 07:17
Joined
Dec 27, 2013
Messages
32
Hi All,
This is regarding "Importing TEXT file" into Access's table. The Issue is with "Long file naming". This is working fine.

In the attached Database, On the button click, I'm importing data in TEXT file into table called "TABLE".
"DoCmd.TransferText acImportDelim, "Text_Spec", "TABLE", StrFile, True" has been used to accomplish this task.

While creating the Import Specification "Text_Spec", i had selected file "1.txt" (':' is the delimeter) to be imported into "TABLE".

On the Form's button click, The code prompts for the File picker and "1.txt" is selected. The data in the file is smoothly loaded into the "TABLE" into it's respective columns.

Whereas in the FilePicker, when i select another file "abcdefgh_jklhmhhhhhh.txt" (contains the same data as in 1.txt).
The system THROWS ERROR - '3011' - Make sure the Object exists and that you spell it's name and the path name correctly.

But when i rename the "abcdefgh_jklhmhhhhhh.txt" to "abcdefgh_jkl.txt", shorter file name, the Import works fine.
I would like to know if the FileNaming length matters? I created macro - "TransferText" action and gave the entire file path "abcdefgh_jklhmhhhhhh.txt" and this file was imported to table.

I would like to know what needs to be done in the code to fix this file length issue? Not sure if I'm missing something here.
 

Attachments

  • ImportTextFile.zip
    19.2 KB · Views: 83
  • 1.txt
    163 bytes · Views: 97
  • abcdefgh_jklhmhhhhhh.txt
    179 bytes · Views: 91
Last edited:

Users who are viewing this thread

Top Bottom