> Thank You so much Sir. Now, i can see clearly in my head the idea that i wanted to create.
>
You're welcome.
> another Question sir, the tables's original size was 17,396KB and the .cdx file was 14,625KB. After running DBREPAIR, i got a .cdx file with below 11,000KB??
>
> Is the .old cdx file(14,625) reusable, that after repairing the the corrupted table, i could still use the old .cdx file?
>
The code you posted uses the Reindex command - which would kind-of "defragment" the compound index file, which works well usually, and actually can shrink size drastically sometimes.
On the other hand, Reindex might fail if a CDX is "seriously damaged" so that structural infos are missing. If so, you'd need to "Delete Tag All", and then do an "Index On ..." line for each index tag similar to what you originally had done in the Table Designer.
(BTW, I had added a few lines to the previous message in the meantime)
hth
-Stefan