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
LVL 1
mlcktmguyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel PineaultPresident / Owner CARDA Consultants Inc.Commented:
Try something more along the lines of
DoCmd.TransferText transferType:=acImportFixed, SpecificationName:="WRBImport_AddRecord", TableName:="WRBtoGRB_AcctAdd", FileName:="C:\...\MJO_PHLSHGRB_20181015_01.txt", hasfieldnames:=False

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeOwner, Developing Solutions LLCCommented:
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.
PatHartmanCommented:
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.
Gustav BrockCIOCommented:
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
mlcktmguyAuthor Commented:
Thanks You.  After all these years still making syntax errors.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.