OK Dragan, it may take me a minute or two to catch up, so bear with me....
Is this index recovery something you want to happen all the time? How often are you seeing file corruption?
If this is something that will only run, say, nightly or even weekly, then we can assume that it is going to be a primarily administrative task. That being the case, we should be able to get exclusive access to the DBC...correct? (I certainly hope so.)
In this case, if the indices were maintained up until the time of the corruption, then data integrity (PK) should be OK. At this point, if you wipe out the index in question and the indices on any children and the open then corresponding tables using an error handler to capture missing cdx errors, shouldn't you be able to rebuild the indices without having to do any low-level manipulation?
Matt McDonnell
...building a better mousetrap with moldy cheese...