>>Having indexes update is an automatic process. Is this a sporadic problem or is it consistient? Are you index files in the same directory as your DBF's? How big is your data? Are you running out of disk space? Just some things to think about....
>
>The problem is consistient but it happens on different dbfs every time and not on the same particualar dbf. Moreover, during updations, we are not removing the order on any field and updating the dbf with the order set. In this process, the field value might also change and therefore Foxpro has the double job of verifying the new value in the field and update the index file. Is this the cause of the trouble. ?
>
>The index files are in the same directory as dbfs
>Data is not much. 2 to 3 MB
>There is lot of disk space
Are you replacing the key value on more than one record at once? You may be doing what I stumbled upon several years ago. If this is your scenario:
replace keyfield with newvalue while keyfield=oldkeyvalue
It may work, but it usually won't, because the first record's position in the index changes, and it most probably won't find the next record with the old key value right after it, except when you're changing its value to something less than the current value, but still greater than the next smaller key. What I ended up doing for cases like this is
seek oldkeyvalue
calculate min(recno()), max(recno()) to lnFirst, lnLast while keyfield=oldkeyvalue
lnOldOrder=TagNo()
set order to 0
go lnFirst
replace next lnLast-lnFirst+1 keyfield with newvalue for keyfield=oldkeyvalue
set order to lnOldOrder