Board index » delphi » Locate/Find Next problem

Locate/Find Next problem

I have nearly finished writing an app that uses DBF files of around
250,000 records.

My question is, finding the first record using 'Locate' is fine, but
how do I find the next record?

The problem is I cannot change the index (for the search) for 2 reasons:

1. I am using Ranges to limit the records (filters are too slow)
2. Switching indexes takes time

Is there any way to find the next record matching a certain condition
(eg ORGANISATI = 'TESCO STORES LTD')
---
Also, Once I have found a match, I need to know if it is the only
match. (An answer to the above question would solve this, but
otherwise I would like to find any other better ways). Currently, I
apply a filter to the data equivilant to the match condition - This
takes time. I then need to find out if only 1 record was returned.
The 'recordcount' function is rediculously slow (even if only 1
record was matched) so I fetch next and fetch prior (if I was able to
do either of these without hitting BOF or EOF then more than one
record was found)..   Is there a better way?

Note I have tried all of the above with SQL, SQLs seem to be too slow
- I am looking for split second responses.

Thanks for any help.

CARL NUNN
Aligned Assetts

 

Re:Locate/Find Next problem


  Give InfoPower a trial run.  They have Search Dialog and Lookup Dialog
components that implement this very well.  i.e., your filter criteria
instantly narrows down the displayed records, any indexes you have can be
selected via a combobox, and your record # of filtered records displays in
a status bar when the table type is Paradox.  InfoPower 2.02 also has a
Filter Dialog component if the information to be searched is not indexed.

Paul Rice

Quote
Carl Nunn wrote:
>I have nearly finished writing an app that uses DBF files of around
>250,000 records.

>My question is, finding the first record using 'Locate' is fine, but
>how do I find the next record?

>The problem is I cannot change the index (for the search) for 2 reasons:

>1. I am using Ranges to limit the records (filters are too slow)
>2. Switching indexes takes time

>Is there any way to find the next record matching a certain condition
>(eg ORGANISATI = 'TESCO STORES LTD')
>---
>Also, Once I have found a match, I need to know if it is the only
>match. (An answer to the above question would solve this, but
>otherwise I would like to find any other better ways). Currently, I
>apply a filter to the data equivilant to the match condition - This
>takes time. I then need to find out if only 1 record was returned.
>The 'recordcount' function is rediculously slow (even if only 1
>record was matched) so I fetch next and fetch prior (if I was able to
>do either of these without hitting BOF or EOF then more than one
>record was found)..   Is there a better way?

Other Threads