Avatar of mlcktmguy
mlcktmguy
Flag 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
Microsoft Access

Avatar of undefined
Last Comment
mlcktmguy

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Daniel Pineault

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dale Fye

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.
PatHartman

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 Brock

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
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
mlcktmguy

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