PRB: IDX with the Same Name as the Table Won't Open

ID: Q129536

The information in this article applies to:

SYMPTOMS

You are unable to open a table that has an IDX with a name identical to the table name.

CAUSE

If a CDX exists that has the same name as its table, the table cannot be opened with an IDX that also has the same name.

For example, if you have a table named TEST.DBF, and indexes named TEST.CDX and TEST.IDX, you will not be able to open the table.

RESOLUTION

Sometimes programs written in previous versions of FoxPro or in FoxBASE+ use IDX files instead of CDX files. These programs are likely to contain the following code:

   USE customer INDEX customer

This code will open the customer database with the CUSTOMER.IDX if CUSTOMER.CDX does not exist. If a CDX is created, subsequent execution of this command will open customer, but no order will be set and no error will displayed. Deleting the CUSTOMER.CDX will allow the program to function as it previously did.

NOTE: The first time a table is opened after a CDX has been deleted the following message is displayed:

   "Structural CDX file not found"

Choose the Ignore button to continue.

STATUS

This behavior is by design.

Additional reference words: FoxWin 2.60a KBCategory: kbprg kbprb KBSubcategory: FxprgTable

Last Reviewed: June 27, 1995