Search code examples
databasefoxprovisual-foxpro

Is it possible to clear a .CDX file?


I was ordered to clean out some .dbf files (foxpro databases). After "zap" them with a program I downloaded I found that the .cdx files associated to them had partial information about the rows deleted in the dbf files.

Is there any way of clearing the dbf/cdx files ?


Solution

  • Yes,

    from within VFP, you can use the table exclusively and delete all index tags, thus removing the reference to the .CDX files... Ex:

    Use YourTable EXCLUSIVE DELETE TAG ALL

    However, if you have just used the table exclusive and zapped it (pack is thus implied), the indexes will automatically be updated and still retain the .cdx file. By doing the DELETE TAG ALL actually removes reference to the .cdx file completely.