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!

index does not match databas file. recreate index

Status
Not open for further replies.

georgeluck

Technical User
Jan 25, 2007
4
0
0
GB
How do I do this?
 
Depending on what the problem that caused the "not matching":

reindex (for this command the key should be ok and the problem is the number of records being indexed)

index on fieldname to indexname (this creates a new index, depending on what kind of index (cdx or idx) you want)

Rob.
 
George

In the command window

USE <mytable> EXCL

DELETE TAG ALL

INDEX on <indexexpression> TAG <tagname>

CLOS DATA

Roger
 
when you say tagname, what do you mean? apologies for my lack of knowledge
 
replying to rob444's post, if i want to index multiple fields, how would i do that?
 
George

Each index has a name, or tag. By <tagname> I mean that you should replace this with the existing name of the tag.

I agree with Dave Summers that you should search this forum for previous answers to this question, and also the FoxPro help file.

Roger
 
Unless you use the REINDEX command, you will need to have some knowledge of the various indicies which have been built on the data table.

Each index has an Expression and a TAG (reference name).
The Expression is built as a mathematical or string function on one or more of the table fields.

Example:
INDEX ON (Field1 + Field2 + Field3) TAG MyIndex

If you are able to resolve the probem using the REINDEX command, FP will utilize the existing Indicies and re-build the index file.

If you are not able to use REINDEX then you will have a more challenging problem. You will need to either find out all of the possible indicies (one or more) on the data table and manually re-create each one.

Maybe you could get lucky and find a backup of the table's index file and utilize it.

Worst case scenario would be that you cannot find any information on the table's indicies. In that case you could look through the program's source code and attempt to identify how the various indicies are being used and how they are being referenced. In that manner (albeit a tedious one) you can determine how the indicies need to be re-created.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top