Access 2010 Error: "The text file specification '<number>' does not exist. You cannot import, export, or link using the specification" when running a macro

Article ID: 2581495 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

In a Microsoft Access 2010 database when you run the ImportExportText macro or a macro that imports, exports, or links a text file using a saved Specification Name and the macro was created or modified in Access 2010, you receive the following error when you attempt to run the macro:

"The text file specification '<x>' does not exist. You cannot import, export, or link using the specification."


Note that the value of '<x>' corresponds to the specification's index number in the list of Specs for the database.

CAUSE

This is a known problem in Microsoft Access 2010.

RESOLUTION

Apply the June 2011 cumulative update for Microsoft Access 2010:

http://support.microsoft.com/kb/2544022

Important to Note: If you modified the macro containing the TransferText action in Access 2010 before applying the June 2011 cumulative update, you will still receive the error message running the macro after applying the update. If you open your macro in design view, you will see the text specification has changed to the specification index number ('x'). In order to correct the issue, you must reselect the proper text specification name in Access 2010 and save the macro.


Workarounds:

This problem can be worked around using one of the methods described below.

Method 1: Create/edit macros in a previous version of Access.
  1. Open the database in Microsoft Access 2007.
  2. Select the desired specification name in the TransferText action section of the macro.
  3. Save and close the macro.
  4. Open the database in Microsoft Access 2010 and run the macro.
Method 2: Use the TransferText action in Visual Basic for Applications, rather than a macro.

You can perform the same macro action using VBA code. For example:DoCmd.TransferText acImportDelim,"MyImportSpec","Table1","C:\FileName.txt"For more information on using TransferText see the following article:

DoCmd.TransferText Method (Access)
http://msdn.microsoft.com/en-us/library/ff835958.aspx

Method 3: Rename the specification so that it matches its position within the list of specs. To save an existing specification with a new name (essentially renaming the spec) follow these steps:

In the database, start a new text file import by selecting the External Data tab and in the Import & Link group, click Text File.
  1. Select any text file to import, click ok
  2. Click Advanced
  3. Click Specs
  4. Select the existing specification, click Open
  5. Click Save As and name it with the corresponding index number (in the list of specs the first is "1", the second is "2", etc.)
  6. Click Specs
  7. Select the old specification name and click Delete
  8. Now the old specification is named with the index number
  9. Cancel out of the import wizard windows
  10. Open your macro in design view
  11. Within the combobox for the specification name, select the new specification name

MORE INFORMATION

Macros created in earlier versions of Access will run properly in Access 2010 until they are edited in Microsoft Access 2010.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2581495 - Last Review: October 19, 2011 - Revision: 2.1
APPLIES TO
  • Microsoft Access 2010
Keywords: 
KB2581495

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com