Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help NEW but desparate how to rebuild corrupt index 2

Status
Not open for further replies.

saustin

MIS
Feb 19, 2001
336
0
0
US
Hi,
Have a foxpro back end and an error message that the index needs to be rebuilt. Have the dbf how do you rebuild the index in foxpro 6.0.

Apologies in advance for lack of foxpro wisdom.

thanks !!!!
 
Code:
DELETE TAG ALL
INDEX ON <key> TAG <tag>
INDEX ON <next key> TAG <next tag>
...

Tamar
 
Tamar has gone straight to the solution but I'll just fill in the gaps and warn you not to be tempted by the REINDEX command.

All REINDEX does is update a good index. If the index is corrupt then you have to go back to basics and create each tag again in code.

Don't run these commands from the Command Window. Write yourself a little program and save it - you might never need it again to recreate an index but a heavily-used index file will grow in size and these commands will reduce the size again.

Geoff Franklin
 
Many thanks for the super advice. Back up and running again.
Cheers, Steve.
 
What was unsaid here was a couple other basic things to do before you try to delete tags if the index names and expressions aren't documented and at hand.

First, is the table using a compound index (.cdx) or standalone indexes (.idx)? Whichever, be sure you know what the tag names and expressions are before you delete the tags or standalone indexes. DISPLAY STATUS with the table and indexes open will show the information you need.

Another alternative to get the index details is to retrieve them from backups, just be sure to do that in a separate folder so current and backup tables aren't mixed together.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top