Microsoft KB Archive/145656

= ACC: Cannot Export Part of a Table to a Text File =

Article ID: 145656

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q145656



Novice: Requires knowledge of the user interface on single-user computers.



SYMPTOMS
When you try to omit fields from the export specification in the Export Text Wizard (or Text Export Wizard in Microsoft Access 7.0), you may receive the following error message:

The number of fields in your export specification does not match the number in the table you have chosen to export.

Or, if you convert a database (created in a previous version of Microsoft Access) that uses a TransferText action with a fixed-width export specification to output only part of a table, you may receive the following error message when you run the TransferText action:

INSERT INTO statement contains unknown field name ' '



CAUSE
Microsoft Access 7.0 and 97 do not allow you to customize the export specification to omit specific fields from a table (or query). This behavior differs from earlier versions of Microsoft Access.



RESOLUTION
You can create a query that includes only the fields that you want to export to the fixed-width or delimited text file. Then, you can run the Export Text Wizard to export the query and create an Import/Export specification with only the query fields. Or, you can run a TransferText action to export the query using the Import/Export specification created with an earlier version of Microsoft Access.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 7.0 and 97.



Steps to Reproduce Problem
 Open the sample database Northwind.mdb. In the Database window, click the Tables tab and select the Orders table. On the File menu, click Save As/Export. In the Save As box, select "To an External File or Database", and then click OK. In the Save Table 'Orders' As box, click Text files (*.txt, *.csv, *.tab, *.asc) in the Save As Type box, and then click Export.</li> In the Export Text Wizard, click the Fixed-Width button.</li> Click the Advanced button.</li> In the Orders Export Specification box, select the EmployeeID row and press DELETE.</li> In the "You are about to delete 1 record(s)" box, click Yes.</li> In the Orders Export Specification box, click Save As. Note that you receive the following error message:

The number of fields in your export specification does not match the number in the table you have chosen to export.

</li></ol>

<div class="references_section">