MSQuery: Illegal Duplicate Key When Adding Character Data

Last reviewed: September 12, 1996
Article ID: Q110603
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0
  • Microsoft Query, version 1.0

SUMMARY

When you add records to a table, if an index field (whose type is defined as character) is left blank, and if Microsoft Query is instructed to add another new record, the following error message will appear:

   Illegal Duplicate Key.

After a record is entered, Microsoft Query adds an empty record below it, ready for data input. The character field in the previously entered record is also empty; therefore, when Microsoft Query adds a new, blank record, the two character fields are duplicates of one another and Microsoft Query reports the error described above.

When you receive this error message, acknowledge the message and return to the just completed record to enter the correct value in the appropriate field.

WORKAROUND

To avoid the error message, entered data in the blank field.

MORE INFORMATION

Steps to Reproduce Problem

  1. From the File menu, choose New Query.

  2. From the Available Data Sources, select dBASE Files.

  3. Choose Use, and then select a .DBF file.

NOTE: The .DBF file must be indexed (that is, sorted by dBASE).

  1. Choose Add, and then choose Close.

  2. In the table pane, double-click the asterisk (*) to show all records.

  3. From the Records menu, choose Allow Editing.

  4. Note that a new blank record is added to the bottom of the query table.

  5. Move to the bottom of the table and add information, leaving a character field empty.

  6. Press the DOWN ARROW key to add the current record and create a new, empty record.

An alert box will appear with the message "Illegal duplicate key."


KBCategory: kbusage kberrmsg
KBSubcategory: xlquery

Additional reference words: 5.00 datafield MS



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.