I love Access and I hate Access. Just when I think I have a handle on it, it does something else.
I converted a db from 97 to 2003 – I have code behind a button on a form that imports a data file using import specs.
On some of my databases everything works fine. On others I get the error 31519 – you cannot import this file.
Looking at MSKB, I couldn’t find an article on this particular error, but googling around, it seems it is supposedly due
to lack of file extension .txt (A97 imported these files fine)
I would have thought that if it couldn’t import the file into one database, it shouldn’t be able to be imported into any
database.
To clarify: I have the same database copied 3 times (one for each client) and use the same code for import.
There are actually 3 different files – one for each client.
The names of the file that works:
G0005V00 (No extension)
In A97 they imported no problem. In ONE of the 3 databases. it imports fine. In the other 2, I get the error.
Here is the import code for the one that works:
DoCmd.TransferText acImportFixed, “CAP 2005”, “CAP ABC “, _
“R:DEF HMOs 2006XYZ 2006JUN 2006CAP FILESABCG0005V00”, False, “”
Here is the import code for the ones that don’t work (same code, different client!):
File name = G0006V00 (no extension)
DoCmd.TransferText acImportFixed, “CAP 2005”, “CAP DEF “, _
“R:ABC HMOs 2006XYZ 2006JUN 2006CAP FILESDEFG0006V00”, False, “”
Based on the MSKB article, it is because there is no “.txt” extension. But my (sometimes illogical) logic
says, that if it was due to the lack of a file extension txt then NONE of the files could be imported.
So I am not sure where I should be looking. Is it the files themselves that are creating the issue?
Apparently the import specs, the import code and the lack of a txt extension is not what is causing the error.
Any suggestions where to look? It is quite confusing !
Thank you.
Michael