ACC95: TransferText Method or Macro Action May Cause Error
ID: Q155513
|
The information in this article applies to:
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
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 <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:
- Create a select query based on the table that causes the error. Use
that query name in place of the table name in your macro or procedure.
- 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:
Option Explicit
- Type the following procedure:
Function TestError()
DoCmd.TransferText acExportDelim, , "Employees", "C:\Testerr.txt"
End Function
- To test this function, type the following line in the Debug window,
and then press ENTER.
?TestError()
REFERENCES
For more information about the TransferText macro action, search for
"TransferText action," and then "TransferText Action" using the Microsoft
Access 7.0 Help Index.
For more information about the TransferText method, search for
"TransferText method" using the Microsoft Access 7.0 Help Index.
Keywords : kb3rdparty kberrmsg IsmTxtd
Version : 7.0
Platform : WINDOWS
Issue type : kbbug