RecordSet Movement besides Next?

  1. 2 months ago

    Karen A

    Jun 16 Pre-Release Testers

    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

  2. Dave S

    Jun 16 San Diego, California USA

    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

  3. Karen A

    Jun 16 Pre-Release Testers

    @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

    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

  4. Ralph A

    Jun 16 Santa Monica, California

    @Karen A 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 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.

  5. Jean-Yves P

    Jun 16 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    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 ...

  6. Joost R

    Jun 16 Pre-Release Testers, Xojo Pro The Netherlands

    @Jean-YvesPochez only movenext works with all databases.

or Sign Up to reply!