Recordset is fetching 1599 record immediate after 1532 record. Why?

manoj22_srivastava

New member
Local time
Today, 05:24
Joined
Mar 22, 2009
Messages
5
Hello All,

I am facing a problem while firing query to Database. I am using Visual Studio 2008 with MS Access 2000. I am firing query from IDE and trying to Open the recordset and fetch the data through ADODB::Recordset. Upto 1532nd record, it is accessing records correctly. After 1532nd record , it is accessing 1599th record and so on. Means a kind of automatic shuffling is happening. Can anyone please tell me, what is the exact problem? Same query is working for MS SQL 2005 fine.


:eek:
 
Have you tried specifying a sort order?
 
Records are not really stored in the tables in any particular order (at least none you can guarantee to give you a specific order) and therefore you need to use a query with ordering to give you a specific order.
 
Hi, First of all thanks for your response. Actually, I am exporting data in a file while Export operation. I stored data in Access in sorted order. But, while exporting, it is storing upto 1532 record fine then after it jumped to 1599 record and stored from 1599 onwards. While exporting, I am accessing fields by recordset i.e.
spRecordset->Fields->Item[lFieldIndex]->get_Value(&varData);. varData is of variant type. Please suggest something if you people have some other options in your mind.

Thanks for your co-operation.

:(
 
first have a look at the table - if the recordids are autonumber fields, then there may be a gap between 1532 and 1599 anyway

second - you need to understand that access makes no distinction between records in a table - databases make use of set theory, and a table is merely a collection of similar records - access (jet) can/may retrieve these records in any order, because all records are part of the same set, and the order is not significant - what happens is that we impose a filter/criteria to select a subset of the records, and we impose an ordering to control the way we see those records

so in your case, either
there are no records 1533 to 1598 OR
the records are being retrieved but not in the sequence you expect OR
something in your selection criteria is excluding them from the set of returned data
 

Users who are viewing this thread

Back
Top Bottom