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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting error 114

Status
Not open for further replies.

camidon

Programmer
May 9, 2000
268
US
114 Index Does not match the table. Delete the index files and re-create the index

For some reason I can't open this table, re-index this file or anything. Is there any way to correct this problem.
 
Recreating the index is not the same as REINDEX. If the table is "free" or you aren't using any referential integrity in the DBC, then you can simply delete the .CDX file for this table and then use the INDEX ON command to recreate the index(es).

This technique assumes that you know what this tables' indexes are. Unfortunately because the index expressions are stored in the .CDX header, when this file gets corrupted you can't do a REINDEX. Note: If you've got a backup of an uncorrupted .CDX for this table, you can restore it, and then the REINDEX will probably work.

If you want to plan ahead for the next time, check out the GENDBC.PRG that comes with VFP, or consider the Stonefield Database Toolkit, which stores this "meta data" in separate tables and makes it easy to fix these and other problems quickly and easily.

Rick
 
How would I find out what the indexes are if I'm not already sure? I'm new to this particular project and unfortunately I'm now the only one involved with it.
 
Unless you have some external documentation or you have a backup copy of the .CDX, you'll have to read through all the code that accesses this table and "guess" what the indexes are. (Look for SEEK()'s, SET RELATION's, SET ORDER TO, etc.)

Rick
 
If I have a backup copy of the .CDX, then how could I get the indexes out of it?
 
Also, what can I do if referential integrity is enforced??
 
You can open the .cdx like it was a regular table and browse it to see what's there.

As for referential integrity, do you have reason to believe that there are breaches in the integrity which have to be considered? I'm not sure that the state of your indexes is directly related to RI.

DED
 
How do I open the .cdx? Every time I try to open the .cdx file it tries to open the .dbf.
 
If you've got a backup .CDX, then you can restore it, and then the REINDEX will probably work (as "Note"d in my first message).

If it does work, then use the Documentation Wizard or GENDBC to get these and the other files Indexes documented.

If this doesn't work, then you'll need a hex viewer program to examine the .CDX file. (You get a free one with VFP - C:\Program Files\Microsoft Visual Studio\Vfp98\Tools\Hexedit\Hexedit.exe.) The file layout for the internal VFP files is partially documented in the Help file: Contents (tab) -> Using Visual FoxPro -> Programmer's Guide -> Appendix -> Compound Index File Stucture (.CDX).

For more details you can also go to C:\Program Files\Microsoft Visual Studio\Vfp98\Filespec\ - there are .DBFs with the info, and even reports to print them out!. (Although there is no more info on .CDXs there.)

Rick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top