ACC: dBASE Unique Index Does Not Behave as Expected

Last reviewed: May 30, 1997
Article ID: Q163279
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

If you choose a unique field when you link to a dBASE table, the index only contains records that are unique with respect to the given index expression. For example, a .dbf file may contain "n" records, while the unique index may contain "m" entries, where "n" does not equal "m." This means that when the database is viewed by a UNIQUE index, it may appear to have fewer records then it actually does.

CAUSE

There is no concept of primary indexes in dBASE. All indexes are taken as secondary indexes. The dBASE command SET UNIQUE ON only limits which records are displayed.

RESOLUTION

One way to prevent this scenario is to SET UNIQUE OFF and REINDEX in dBASE. This will allow all records to be displayed. Another solution is not to choose a unique field when you link the dBASE table. A third solution is to edit manually the INF file that is created when you link a dBASE table. Following are examples of the INF file.

Contains Unique Field:

   [dBASE III]
   NDX1=C:\ACCESS\SAMPLES\city.ndx
   [UIDX1 city#idx]
   NDX1=C:\ACCESS\SAMPLES\city.ndx

Without Unique Field:

   [dBASE III]
   NDX1=C:\ACCESS\SAMPLES\city.ndx

MORE INFORMATION

The following example helps to illustrate the concept.

A dBASE file contains the following records:

   Company Name        Address        Phone
   ------------------------------------------------
   ABC                 123 4th ST.    (888)888-8888
   ABC                 123 4th St.    (999)999-9999
   CDF                 1st S.         (777)777-7777

The index is created on the Company Name field. If the Unique setting is on in dBASE, then only 2 records would be displayed (the 1st and 3rd).

The field that is designated as unique allows you to enter duplicate information. However, when you query the file, the duplicate information does not show.

dBASE is manufactured by Borland, a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding this product's performance or reliability.

REFERENCES

For more information about linking XBase files, search the Help Index for for "dBASE."


Additional query words: Fox attach
Keywords : IsmXbase kb3rdparty
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


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: May 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.