Microsoft KB Archive/92349

= PRB: Resolving &quot;Structural CDX File Not Found&quot; Error =

Article ID: 92349

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft FoxPro 2.0
 * Microsoft FoxPro 2.5b for MS-DOS
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a

-



This article was previously published under Q92349



SYMPTOMS
Issuing a USE command causes a &quot;Structural CDX file not found&quot; error to occur.



CAUSE
The associated structural .CDX file is not present in the current directory and SAFETY is on.



RESOLUTION
Use one of the following three methods to remove the reference from the CDX file and allow FoxPro to open the DBF file:

 Choose the Ignore button instead of the Cancel button. FoxPro removes the reference to the structural .CDX file from the .DBF file header and displays a message to indicate that the reference was removed. FoxPro opens the database file after removing the reference. Use SET SAFETY OFF to suppress the error message. However, because this method disables the file-protection facility, no warning is displayed when a file may be overwritten.  Use an ON ERROR statement to trap the structural .CDX file error. With the code below, FoxPro can automatically remove the reference without displaying an error message. SET SAFETY ON                   && Enable file protection. USE customer                    && Open a DBF file. INDEX ON city TAG city ADDITIVE && Create structural CDX file. CLOSE ALL                       && Close all files. DELETE FILE customer.cdx        && Remove CDX file.

ON ERROR WAIT WINDOW &quot;REMOVING REFERENCE AUTOMATICALLY&quot; NOWAIT *** Trap the error and print a message

USE customer *** Invoke the ON ERROR routine to automatically remove the *** reference.

WAIT WINDOW &quot;OK to issue USE now !&quot; NOWAIT

ON ERROR *** release the ON ERROR statement NOTE: FoxPro does not open any files after the ON ERROR statement removes the reference. The user must issue the USE command again to access the information in the .DBF file. 

Additional query words: VFoxWin FoxDos FoxWin suppress missing

Keywords: kbcode KB92349

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.