Q: How do I rebuild indexes on dBase tables?
A: In order to rebuild indexes on dBase tables you will need to understand a couple of commands used in the command window.
The first command you will need to know is the USE command. In the command window you would type:
This makes the table you are going to work with available to your commands in the command window.
The next command you will need to use is the DISPLAY STATUS command. This command will give you information about the table that you are currently using, including all of the index information associated with that table. By using this command you will be able to see all of the indexes that are associated with the table and the expression which defines each index. You'll need to write this information down. This information is presented to you through the command window.
If you have a lot of indexes on the table you can save yourself the effort of writing them all down by using the following command:
LIST STATUS TO PRINT
This command presents the same information as the DISPLAY STATUS command, but using this command will display all the information about the table and print it on your printer.
The next command you will need to use is the DELETE TAG command. In the command window you would type:
DELETE TAG <tagname>
DELETE TAG myindex
You will need to issue this command for each index on the table.
Once you have done that your table will no longer have any indexes associated with it. You are now the position to be able to recreate your indexes.
To do this you'll need the following command:
INDEX ON <expression> TAG <tagname> OF <.mdx filename>
INDEX ON last_name TAG lastname OF myfile.mdx
This command would index a table on the last_name field of the table and name that index 'lastname'. This index would be stored in the index file named 'myfile.mdx'.
You would repeat this command for
each index that you want to place on the table. Once you have done that your
table should be re-indexed and ready for use.
QA/Tech Support Engineer