Results 1 to 3 of 3

Thread: Moving to the last record in a recordset.

  1. #1

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818

    Question Moving to the last record in a recordset.

    I have the following code in my app :

    *************************************************************
    Set db = New Connection
    db.CursorLocation = adUseClient
    ' db.open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Developers\SCR Database\SCRsystem.mdb;"
    db.open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SCR System\SCRsystem.mdb;"


    ' Open employee table.
    Set adoprimaryrs = New Recordset
    adoprimaryrs.open "select * from [SCR List]", db, adOpenStatic, adLockOptimistic
    adoprimaryrs.MoveLast
    *************************************************************
    For some reason, the last record in this collection is not the last record in the database (if I check it manually).

    Anybody know why this would be so ?

  2. #2
    Member
    Join Date
    Feb 2001
    Location
    St. Louis, Missouri
    Posts
    49
    You could try setting your connection to an ADODB.connection and your recordset to an ADODB.recordset. That ensures that the ado methods work properly.

    Eva

  3. #3

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818
    OK done that.

    Still get same response. The recordcount tells me 281, which is correct, but when I try a ".movelast" and then display a field from the record, it is from a record roughly 2/3 of the way through the collection !!!

    There are no filters on my SQL statement, as you can see above, so I'm a bit stumped on this one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width