Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CursorType (Access 2000)

    As I understand that the adOpenForwardOnly cursortype allows us to travel through a recordset in one direction. How come I can still use rst.moveprevious with the same recordset?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CursorType (Access 2000)

    If there isn't some other reason to use the forwardonly cursor, use a different type. You can't moveprevious on a forward only cursor.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CursorType (Access 2000)

    but what troubles me is that I CAN moveprevious with this cursortype. I cannot understand why.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: CursorType (Access 2000)

    Immediately after your rst.MovePrevious, add the line MsgBox rst.CursorType. Is it really 0? Seems impossible.

  5. #5
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CursorType (Access 2000)

    It shows 1 not 0 but here is my program:

    Private Sub cmdForwardOnly_Click()
    Dim dbs As ADODB.Connection
    Dim rst As New ADODB.Recordset
    Set dbs = CurrentProject.Connection
    rst.Open "customer", dbs, adOpenForwardOnly, adLockOptimistic
    rst.MoveLast
    txtName = rst![customer name]
    MsgBox rst.CursorType
    rst.MovePrevious
    MsgBox rst.CursorType
    txtName = rst![customer name]
    End Sub

    Thanks

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: CursorType (Access 2000)

    My trusty reference says "If the provider doesn't support the requested cursor type then it may use a different type." Your provider is substituting a keyset cursor. Frankly, I couldn't tell you why.

    <img src=/w3timages/blueline.gif width=33% height=2><img src=/w3timages/blueline.gif width=33% height=2><img src=/w3timages/blueline.gif width=33% height=2>

    Oh, hey. "...when using server-side cursors, Access only supports keyset cursors (unless you specify a read-only recordset). So if you are locking your recordset, Access will always return a keyset cursor

Posting Permissions

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