Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    paging rset via ado and vb (6.0)

    i use this code to open rset:

    SSQL = "SELECT * FROM STAFF ORDER BY NOMINATIVO ASC"
    RSD1.Open SSQL, CNSQL2, adOpenForwardOnly, adLockReadOnly

    now is possible to navigate in reset similar a paging << < > >>

    in effect i ahve 4 button on form:

    > go to next

    < go to previuos

    >> go to the last

    << go to the first

    how to assign to the button the command to paging the reset?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: paging rset via ado and vb (6.0)

    You specify adOpenForwardOnly so you cannot move backwards. If you want to move forwards and backwards, you must specify another cursor type, e.g. adOpenKeyset.

    You can then use

    RSD1.MoveNext

    RSD1.MovePrevious

    RSD1.MoveLast

    RSD1.MoveFirst

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: paging rset via ado and vb (6.0)

    wow work!...
    But how to intecept the and of reset when use movenext?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: paging rset via ado and vb (6.0)

    Something like

    If Not RSD1.EOF Then
    RSD1.MoveNext
    End If

    For MovePrevious you'd look at RSD1.BOF

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: paging rset via ado and vb (6.0)

    ok! tks

Posting Permissions

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