Search code examples
indexingvisual-foxprorecreate

VFP. Re-creating indexes


I would like to be able to re-create the index to a table which is part of a database.

The index to the table is corrupted, so the table cannot be opened (certainly not without an error message). I would like to use the information in the database container to reconstruct the index (with its several tags)

Perhaps I could offer the user a facility to browse a list of tables in the database and then choose one table (or maybe all) to be re-indexed or packed. Have looked at DBGETPROP() and CURSORGETPROP() function calls, but have not found options which give me the information I need.

As always, grateful for guidance.


Thanks Tamar. Yes, I had been opening the .dbc, but then wanted the tag names and index expressions.

What I would like to do is build up a cursor with details of the tag names and index expressions for each table in the database.

As far as I can see I need to get the names of the tables from the .dbc and then open each table to find its indexes . I think these are only in the tables themselves not in the .dbc. Can see that the SYS(14) function will give me the index expressions and that TAG() will give me the tag names; Is that the way to go, or is there some function already available which will do these things for me?


Solution

  • The database container is a table, so you can open it with USE to read the data there.