Microsoft KB Archive/155513

= ACC95: TransferText Method or Macro Action May Cause Error =

Article ID: 155513

Article Last Modified on 7/1/2002

-

APPLIES TO


 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q155513



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you export a table using either the TransferText action in a macro or the DoCmd.TransferText method in a Visual Basic for Applications procedure, you may receive the following error message:

INSERT INTO statement contains unknown field name. (Error 3127)



CAUSE
The conditions that cause this error vary depending on the structure of the table you are exporting. The error is related to the number of fields in the table and their data types, in particular the number of Text fields in the table.



RESOLUTION
There are two methods to work around the problem:


 * 1) Create a query based on the table that causes the error. Use that query name in place of the table name in your macro or procedure.
 * 2) Use a text editor, such as Notepad, to create a file called Export.ini. Save the Export.ini file in the destination folder for the text file that you are exporting. The Export.ini file must be larger than 0 bytes, and it can contain any text. For example, you can type a single letter of the alphabet in the file.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 7.0. This problem no longer occurs in Microsoft Access 97.



MORE INFORMATION
The error occurs when you run Microsoft Access 7.0 with Microsoft Windows 95. It does not occur with Microsoft Windows NT Server 3.51 or Microsoft Windows NT Server 4.0.

Not all tables cause the error.

Steps to Reproduce Problem
Using the TransferText Action in a Macro:

 Open the sample database Northwind.mdb.  Create the following new macro:

     Macro Name   Action -     TestError    TransferText

TestError Actions --     TransferText Transfer Type: Export Delimited Table Name: Employees File Name: C:\Testerr.txt Has Field Names: No                        Save the macro, close it, and then run it.

Using the DoCmd.TransferText Method in a Procedure:

  Create a module and type the following line in the Declarations section if it is not already there:

<pre class="fixed_text">     Option Explicit </li>  Type the following procedure:

Function TestError DoCmd.TransferText acExportDelim,, "Employees", "C:\Testerr.txt" End Function </li> To test this function, type the following line in the Debug window, and then press ENTER.

?TestError </li></ol>

<div class="references_section">