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

dbase index files

Status
Not open for further replies.

bsw

Technical User
Jun 19, 2003
1
AU
Hi,

I am using dbase III, and my index files have become corrupt.

I need to create new index files(.mdx files). How do I do this? I need to know the correct syntax.

My file name is Sup.dbf.

Thanks
Bret
 
use sup && opens table in work area
index on field && replace field with actual name of field

you can also index on multiple fields:

index on field1 + field2 + field3....

caveat here is that the fields must evaluate to character data

There's always a better way...
 
Be sure you know exactly what the index expressions are before you delete and rebuld them. Hopefully they're described in the program code or written documentation. If not, DISPLAY STATUS will show what they are, if you can open the tables...

You also need to give a destination tag name for the new index.

INDEX ON <expression> TAG <tagname>

The index espression must be of character type if you are combining fields that are different types. For example:

fails:
Code:
INDEX ON name+age+date TAG not_okay
works:
Code:
INDEX ON name+STR(age,3)+DTOS(date) TAG okay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top