The best way is actually having a sequential key like what foxDev mentioed, but chances are this won't happen in a table where data changes from time to time (deletion, addition, modification, etc).
Suggestions:
1. Open the recordset using ADODB instead of ODBC as they are faster.
2. Is the 'delay' occurring during the opening of the recordset? or you searching for the record. If it is occuring during the 'opening' stage, you may want to try opening the recordset with a Server cursor instead of a Client cursor. I know that really help. I have a recordset of over 10 million records ... Opening it using a client cursor takes about 45 seconds ... about 5 seconds using the Server cursor.
3. Sorry if I seems like insulting but I'm not, just know that some programmers tend to 'loop' until a certain record using recordset.moveNext instead of using the recordset.PageSize and recorset.AbsolutePage properties. This really help to do the paging (of 25 records) part.
Net-net, 500k records should not be a problem with SQL and ADODB provided that they are all configured correctly. This is only an average sized recordset. If it is a stored procedure, you may want to try to isolate if this is a StoreProcedure/View optimization problem instead of an ASP/ADODB/ODBC problem. Good luck.
regards,
- Joseph
================ ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Visit -->
for (Replica) Watches, Pen, Handbags, Hats, Jerseys and more ... at prices that makes your code spin ...
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-