RecordSet Movement besides Next?

I know some DBs support all the RecordSet movement commands (MoveFirst, MoveLast, MovePrevious and of course MoveNext).

But I have never used or felt the need to use anything but MoveNext…

Does anyone really use the others when they are supported?

  • karen

I rarely use MovePrevious or MoveLast, but use MoveFirst quite alot if I want to iterate over a recordset multiple times
Some databases require you to MoveLast in order to get a proper recordcount

[quote=441604:@Dave S]I rarely use MovePrevious or MoveLast, but use MoveFirst quite alot if I want to iterate over a recordset multiple times
Some databases require you to MoveLast in order to get a proper recordcount[/quote]

I’m writing my own RecordSet Serialization methods that send the set data to ac client which then uses that data in the Constructor for a class that mimic a data set… How I implement that depend on how easily i want to do things besides move next…

MoveNext and MoveFirst are straight forward and don’t require much overhears in either processing or RAM…

MovePrevious can be supported by having teh client array store the offsets for each record as one navigates to them (and once one navigates to them everything else - including moving to a record by index is possible.

Alternatively, as teh data set is being built, the offsets could be stored as they are being serialized on they server and transferred with the data. That allows all navigation methods to work immediately…

Which way to do it involves different tradeoffs, with only supporting MoveNext and MoveFirst the most ‘efficient’

  • karen

[quote=441603:@Karen Atkocius]I know some DBs support all the RecordSet movement commands (MoveFirst, MoveLast, MovePrevious and of course MoveNext).

But I have never used or felt the need to use anything but MoveNext…

Does anyone really use the others when they are supported?

  • karen[/quote]
    I use MoveFirst when I want to use the same RecordSet more than once without multiple queries. If I don’t do that, then subsequent calls to the RecordSet will begin where the previous call left off. At least with SQLite that happens.

even movefirst doesn’t work with some databases.
a sqlselect makes a movefirst just after, so a movefirst is useless.
only movenext works with all databases.
I also made my own classes, sort of clone of the recordset, I initialize it from a recordset, then
I can use it with all moves possible, even a moveto …