Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: TransferText Ignores Indexes in Import Specification


View products that this article applies to.

This article was previously published under Q207632
Advanced: Requires expert coding, interoperability, and multiuser skills.

↑ Back to the top


Symptoms

When you import a text file by using the TransferText method or action with an import specification that applies indexes to a field, the resulting table does not contain the expected indexes.

↑ Back to the top


Resolution

Import the text file by using the Import Text Wizard and the appropriate import specification so that the expected indexes appear in the resulting table.

↑ Back to the top


More information

Steps to Reproduce Behavior

1.Start Microsoft Access, and then open the sample database Northwind.mdb.
2.Export the Shippers table to a tab-delimited text file named Shippers.txt in the root directory of drive C. Click to select the Include Field Names on First Row check box.
3.On the File menu, point to Get External Data, and then click Import.
4.In the Import dialog box, click Text Files in the Files of type box; then, locate and double-click the Shippers.txt file on drive C.
5.On the first screen of the Import Text Wizard, click Delimited, and then click Next.
6.When asked to choose a delimiter, click Tab. Click to select the First Row Contains Field Names check box, and then click Next twice.
7.On the Field Options screen, click the ShipperID field, and then click Yes (No Duplicates) in the Indexed box. Click Next.
8.On the Primary Key screen, click Choose my own primary key, click ShipperID, and then click Next.
9.On the last screen of the Import Text Wizard, click Advanced.
10.In the Shippers Import Specification dialog box, click Save As.
11.In the Save Import/Export Specification dialog box, type Shippers Spec, and then click OK.
12.In the Shippers Spec dialog box, click OK.
13.Back on the last screen of the Import Text Wizard, type Shippers1 in the Import to Table box, and then click Finish.
14.Open the Shippers1 table in Design view, and note that the ShipperID field is the primary key.
To use the TransferText action to import the Shippers.txt file, follow these steps:
1.In the Database window, click the Macros tab, and then click New.
2.Create the following macro named mcrTestMacro:
Action
TransferText

TransferText Action Arguments
Transfer Type: Import Delimited
Specification Name: Shippers Spec
Table Name: Shippers2
File Name: C:\Shippers.txt
Has Field Names: Yes
3.Save the macro as mcrTextMacro.
4.Run the macro, and then close it.
5.Open the Shippers2 table in Design view, and note that it does not contain a primary key.
6.On the View menu, click Indexes. Note that the ShipperID field appears on the list of indexes, but its Unique property is set to No.

↑ Back to the top


Keywords: KB207632, kbpending, kbprb

↑ Back to the top

Article Info
Article ID : 207632
Revision : 2
Created on : 6/28/2004
Published on : 6/28/2004
Exists online : False
Views : 311