Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 207632 - Last Review: June 28, 2004 - Revision: 2.0
ACC2000: TransferText Ignores Indexes in Import Specification
This article was previously published under Q207632
Advanced: Requires expert coding, interoperability, and multiuser skills.
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.
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.
Steps to Reproduce Behavior
- Start Microsoft Access, and then open the sample database Northwind.mdb.
- 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.
- On the File menu, point to Get External Data, and then click Import.
- 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.
- On the first screen of the Import Text Wizard, click Delimited, and then click Next.
- When asked to choose a delimiter, click Tab. Click to select the First Row Contains Field Names check box, and then click Next twice.
- On the Field Options screen, click the ShipperID field, and then click Yes (No Duplicates) in the Indexed box. Click Next.
- On the Primary Key screen, click Choose my own primary key, click ShipperID, and then click Next.
- On the last screen of the Import Text Wizard, click Advanced.
- In the Shippers Import Specification dialog box, click Save As.
- In the Save Import/Export Specification dialog box, type Shippers Spec, and then click OK.
- In the Shippers Spec dialog box, click OK.
- Back on the last screen of the Import Text Wizard, type
Shippers1 in the Import to Table box, and then click Finish.
- 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:
- In the Database window, click the Macros tab, and then click New.
- 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
- Save the macro as mcrTextMacro.
- Run the macro, and then close it.
- Open the Shippers2 table in Design view, and note that it does not contain a primary key.
- 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.
APPLIES TO
- Microsoft Access 2000 Standard Edition
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate