Link to home
Start Free TrialLog in
Avatar of mlcktmguy
mlcktmguyFlag for United States of America

asked on

Error 31519 'You cannot Import This File' when attempting Import

I just received a test file from a client.  It is in fixed fixed length format.

I want to import this file into my Access 2013 application but I am getting a '31519', 'You cannot Import This File'  error when I execute:

DoCmd.TransferText , acImportFixed, _
                     "WRBImport_AddRecord", _
                     "WRBtoGRB_AcctAdd", _
                     False

Open in new window


I have attached my import spec, the table definition and the test file.

Any ideas?
ImportSpec_AddRecord.xlsx
atblOfImportExortSpecs.rtf
MJO_PHLSHGRB_20181015_01.txt
ASKER CERTIFIED SOLUTION
Avatar of Daniel Pineault
Daniel Pineault

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Have you tried doing a manual upload of the file with that import specification?  It might be that the file is not configure the way you would expect, and you are missing the file name from the TransferText method.
Does the text file contain CRLF to separate records?  It looks like you either have a single record in the test file or the file was created on Unix and doesn't have the proper DOS record marks.

I don't know what the .rtf file is supposed to be.
You must use the correct syntax.
I created a minimal import specification, imported manually with success, then ran an import from code:

DoCmd.TransferText  _
    acImportFixed, _
    "MJO_PHLSHGRB_20181015_01 Test", _
    "WRBtoGRB_AcctAdd", _
    "C:\Test\MJO_PHLSHGRB_20181015_01.txt", _
    False

Open in new window

and it created the table with no import errors.

See the attached, please.
Database1.accdb
Avatar of mlcktmguy

ASKER

Thanks You.  After all these years still making syntax errors.