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.

Skipped fields are imported when you import data from a comma-delimited text file to an existing table


View products that this article applies to.

Symptoms

When you import data from a comma-delimited text file to an existing table by using the Import Text Wizard, the data in the fields that you have selected to skip in the Import Specification dialog box are imported to the existing table.

↑ Back to the top


Workaround

To work around this problem, perform one of the following tasks:

Save the Import Specification

  1. Open the database that has the problem that is mentioned in the "Symptoms" section of this article.
  2. On the File menu, point to Get External Data, and then click Import.
  3. In the Import dialog box, click Text Files in the Files of type list.
  4. Locate and then select the text file that you have to import, and then click Import.
  5. In the Import Text Wizard, click Next.
  6. Click to select First Row Contains Field Names, and then click Advanced.
  7. In the Import Specification dialog box, in the Field Information pane, click to select the check boxes under the Skip column for the fields that you do not want to import.
  8. In the Import Specification dialog box, click Save As.
  9. In the Save Import/Export Specification dialog box, click OK, and then click OK to exit the Import Specification dialog box.
  10. In the Import Text Wizard, click Next.
  11. Click to select the In an Existing Table check box, and then select the existing table where you want to import the data. Click Next, and then click Finish.
  12. Click OK when you receive the following message:
    Finished importing file CompletedPathOfTheTextFile to table TableName.

Import Data to a New Table

  1. Open the database that has the problem that is mentioned in the "Symptoms" section of this article.
  2. On the File menu, point to Get External Data, and then click Import.
  3. In the Import dialog box, click Text Files in the Files of type list.
  4. Locate and then select the text file that you have to import, and then click Import.
  5. In the Import Text Wizard, click Next.
  6. Click to select the First Row Contains Field Names check box, and then click Advanced.
  7. In the Import Specification dialog box, in the Field Information pane, click to select the check boxes under the Skip column for the fields that you do not want to import.
  8. Click OK to exit the Import Specification dialog box.
  9. In the Import Text Wizard, click Next.
  10. Click In a New Table, and then click Next.
  11. In the Import Text Wizard, click Next with the default Field Name and Data Type that are given.
  12. In the Import Text Wizard, click Let Access add primary key, and then click Next.
  13. Click Finish to exit the Import Text Wizard.
  14. Click OK when you receive the following message:
    Finished importing file CompletedPathOfTheTextFile to table TableName.

↑ Back to the top


More information

Steps to Reproduce the Behavior

  1. Start Microsoft Office Access, and then create a new database.
  2. In the new database, create a table that is named Employee, with the following columns:
    Column Name     Data type
    -------------------------
    EmplD Text
    Empname Text
  3. Define a primary key on the EmpID field.
  4. Create a sample comma-delimited text file. To do this, follow these steps:
    1. Run Notepad.
    2. Paste the following text in Notepad:
      EmpID,EmpName
      111,John
      222,Jim
    3. Save the file on drive C with the name Employee2.txt.
  5. In the Access database window, point to Get External Data on the File menu, and then click Import.
  6. In the Import dialog box, click Text Files in the Files of type list.
  7. Locate the text file Employee2.txt that you created in step 4, select the file, and then click Import.
  8. In the Import Text Wizard, click Next.
  9. Click to select the First Row Contains Field Names check box, and then click Advanced.
  10. In the Import Specification dialog box, under Field Information, click to select the check box under the Skip column against all the required fields except for EmpID.
  11. Click OK to exit the Import Specification dialog box.
  12. In the Import Text Wizard, click Next.
  13. Click to select In an Existing Table, and then select table Employee2.
  14. Click Next and then Finish.
  15. Click OK when you receive the following message:
    Finished importing file C:\Employee2.txt to table Employee2.
  16. Open the Employee2 table.

    Note All the fields in the Employee2 table are populated, even when you have chosen to import only EmpID.

↑ Back to the top


Keywords: KB824178, kbprb, kbimport, kbwizard, kbexport

↑ Back to the top

Article Info
Article ID : 824178
Revision : 7
Created on : 4/12/2007
Published on : 4/12/2007
Exists online : False
Views : 227