Hi David.
>What happens if the cdx is damaged bad enought to prevent the table from being opened?
I've actually seen a CDX so badly damaged that VFP GPF'd on the USE command to open the table!
>You eather have to run some type of fix program or simple delete its cdx file, open the table back up, and then rebuild the indexes.
Have you considered looking at Stonefield Database Toolkit? One of its many features is the Reindex method, which will recreate the indexes for a table. It knows about all the potential problems that can occur, and uses a lot of low-level "tricks" to do its thing. It took me over 80 hours to write that one routine alone (and SDT will do a lot more than just recreate indexes), so it'll easily pay for itself the first time you use it.
For more information or a demo version, check out