CDaoRecordset SELECT TOP 100 ...

I works with huge database and if I trying to open big
recordset I'm interesting only in final number of records in.
for example 100. The query looks like "SELECT * TOP 100 FROM Table WHERE
..."
but from any reason it doesn't works properly and takes too much time.
What should I do to avoid it ?
vadimmAsked:
Who is Participating?
 
dhodgeConnect With a Mentor Commented:
If you are using DAO the engine gets the first 100 and returns them to you, only when you step past the last record in the initial 100 does it go away and read then next 100.  In effect creating a kind of buffer.
0
 
dhodgeCommented:
The best sollution is to create the snapshot/dynaset in the normal way and read only the first 100 records.  Using the ORDER BY clause will return the records in the correct order.
0
 
vadimmAuthor Commented:
The problem is that engine search for all records and shows
the 100. And I want that the engine will stop searching after
first 100 found records.
All fields in the query are undexed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.