>Hi Ricardo,
>
>First things first, is the song any good?
>
>Next, for the missing cdx file, I have a client who requires software which can recover under any conditions. In a few rare instances the pc has simply been turned off while in the middle of processing records. This kills the index file and you must recreate the index file. I do a lot of validating upon opening the application, and if the index file does not match the table (error #114), I modify the dbc and then delete the cdx. Then open up the table, alter the table for any primary key info, and then recreate the cdx. This works like a charm except I cannot suppress the dialog box when I open up the table to recreate the cdx. I feel really dense because I can easily do it in the command window, just not in code... Do you have any suggestions?
>
>ps. Thanks for your tip about the primary key filters.
>
>Maria
If I read you correctly, try the following. The on error trap prevents dialogue box:
use mytable exclusive
index on myfield tag myfield
use
erase mytable.cdx
lFailed = .f.
on error lFailed = .t.
use mytable exclusive
if lFailed
use mytable exclusive
endif
Mark McCasland
Midlothian, TX USA