CBulkRowset and MovePrev()

Rudolf Wiener <[email protected]> Mon, 22 Jul 2002 22:29:07 +0200
Newsgroups gmane.comp.windows.devel.oledb.devel
Message-ID <[email protected]>
Hi,

I have a CBulkRowset, opened with DBPROP_CANFETCHBACKWARDS set to true. The
following sequence of statements does not work:

    cmd.MoveLast();
    cmd.MovePrev();
    cmd.MovePrev();

The second of the MovePrev() returns DB_S_ENDOFROWSET while there are still
thousands of records in the database. I stepped through the implementation
of the ATL consumer template and -- while I'm not sure I completely
understand everything that's happening -- I have the impression that there
might be a problem in the implementation. To me it looks like MoveLast()
moves to the last record and reads this one record into the cache. The first
MovePrev() issues a MoveNext(-2,true) which in the implementation moves 2
recs to the beginning of the table and tries to read 10 records into the
cache. At this moment the return code is DB_S_ENDOFROWSET (of course, we're
positioned at the second last record) which is handeled correctly because
the implementation realizes it is working with a cache. The second
MovePrev() however checks for a non-S_OK too early and returns the saved
return code DB_S_ENDOFROWSET.

Am I misinterpreting things here or am I missing to set specific properties
or what?

TIA
Rudi

You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.