Foxpro 2.6 Database “Table Is Not Ordered” Error
Foxpro 2.6 database are the oldest data storage platform that we have for our in-house built applications. One of the error that so often happen is the “table is not ordered” error. I was approached by a colleague about this and this happened when a database file was copied from a backup. Thus, the database was not working with the index file.
There are two files TRANSACT.DBF and TRANSACT.CDX. An older copy of TRANSACT.DBF was used with a newer TRANSACT.CDX. Opening the file TRANSACT.DBF throws a message “table is not ordered” error.
I know that there is something wrong with the index of the database. So, I tried to reindex it in the Foxpro 2.6 command window.
USE TRANSACT
REINDEX
The above doesn’t solve the problem. The correct way to reindex is to specify both the database file and the index file through the following.
USE TRANSACT INDEX TRANSACT
REINDEX
Running the following commands inside Foxpro 2.6 command window it shows the following message.
1318 records indexed
Reindexing Tag INDECODE of file - C:\\DBFS\\TRANSACT.CDX
1318 records indexed
Reindexing Tag TENANTID of file - C:\\DBFS\\TRANSACT.CDX
1318 records indexed
Reindexing Tag ROOMNO of file - C:\\DBFS\\TRANSACT.CDX
1318 records indexed
The file could now be opened with sort order by ROOMNO, TENANTID, and INDECODE. I almost forgot, how to do this Foxpro 2.6 database thing, as I work mostly with Oracle database today.





Posted
on
Monday, July 21st, 2008 at 12:03 pm under
