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!

Need help with error message

Status
Not open for further replies.

skymut

MIS
May 7, 2002
36
I've 'inherited' an application that was developed with MS FoxPro for Dos version 2.0. I'm working through a book, but I need to work out an an error that comes up when I go into one of the modules: 'Database is not ordered.' Any thoughts?
 
Hello, I am not familiar with 2.0 but that error message means that that database needs to be reindexed or the application is pointing to a new index tag that needs to be created.

Dale
 
Have tried a reindex, no such luck.
 
I'm assuming you are getting the error message whilst running the application, so your application is trying to do something that causes this error, and I don't know what that might be.

Nevertheless, an example of what might cause this error is where you attempt a SEEK against an unindexed table.

An example.....

this will generate an error
use datafile
m.title = 'TITLENAME'
if seek(m.title,"datafile")
wait window 'yes'
else
wait window 'no'
endif

this will not generate an error
use datafile order title
m.title = 'TITLENAME'
if seek(m.title,"datafile")
wait window 'yes'
else
wait window 'no'
endif


Regards





Pete Bloomfield
Down Under
 
Your assumption is right. Thanks for the tip, I'll have a look at the source code to try and snoop it out.
 
repete is correct, that error is the result of doing a SEEK or SEEK() without having the index order set first. USE your table and set the order before doing the seek. It's always a good idea to save the orginal order prior to setting a new one though, in case a particular order is expected elsewhere in the program and doesn't explicitly set it:

SELECT MyTable
STORE ORDER() TO old_order

IF SEEK(...) &&... or use SEEK ... IF FOUND()
*...do stuff
ELSE
*... do something else
ENDIF

SET ORDER TO (old_order)

Note: I'm not sure if 2.0 had the ORDER() function, if not replace the line:
STORE ORDER() TO old_order
with
STORE SET("ORDER") TO old_order

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top