• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

"rowset does not support scrolling backwards" in Access2000

I keep on getting "rowset does not support scrolling backwards" on the rst.Find.  When I hit "Debug" to get to that line in the code and F8 to run it again, it executes, but goes to EOF. Before the F8, EOF and BOF are false, and the record set is, in fact, at the first record. I know for a fact that the record searched for is there. And if it weren't, it would just go EOF. Here's the code.

      If rst Is Nothing Then Set rst = New ADODB.Recordset
      If rst.State <> adStateOpen Then
         rst.CursorLocation = adUseClient
         If Recordset!SOURCE = "COUNTY_NM" Then
            rst.Open "SELECT * FROM county_nm", CurrentProject.Connection, , adLockOptimistic
         Else
            rst.Open "SELECT * FROM permits_nm", CurrentProject.Connection, , adLockOptimistic
         End If
      End If
      If Not (rst.BOF Or rst.EOF) Then
         strFind = "ADDRESS='" & Me.ADDRESS & "'"
         rst.MoveFirst
         rst.Find strFind
         If Not rst.EOF Then
              ' record is found and load it.

0
cellorando
Asked:
cellorando
  • 2
  • 2
  • 2
  • +2
5 Solutions
 
GrahamSkanCommented:
Try:
           rst.Open "SELECT * FROM county_nm", CurrentProject.Connection, adOpenStatic, adLockOptimistic
0
 
leonstrykerCommented:
Your currect cursor is set to adOpenForwardOnly, it is a default setting, therefore you may not move through it or test the BOF and EOF status

adOpenStatic would not work if you plan to update your data later on.  You may wan to try adOpenDynamic or adOpenKeyset.

Here is an explaination of the Cursor property:

http://www.activeserverpages.ru/ADO/daprop02_7.htm

Leon

0
 
cellorandoAuthor Commented:
I tried adOpenStatic, adOpenDynamic, and adOpenKeyset and got the same error.  The addresses are all correct, and the rst.Find always worked before.  rst.MoveFirst seems to work and EOF & BOF are both false before the Find.

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
leonstrykerCommented:
Try:

 rst.CursorLocation = adUseServer

Leon
0
 
domjCommented:
I reckon the error is occurring on the rst.MoveFirst. I have had this one before myself. My guess would be that it would only be when the condition rst.State <> adStateOpen is correct and the script is working from an already open recordset. I am assuming that the cursor would be wherever the previous find statement left it and therefore would need to track back to find MoveFirst. My suggestion would simply be what I did which was to make the recordset open each time whether it is currently open or not (obviously if it was currently open you would need to close it before re-opening).

Dom
0
 
KarcOriginCommented:
Hi,
I have test your sample code (with little modification) and it is working fine. I used MS Ado library 2.7 (msado15.dll)


Private Sub Command1_Click()
    Dim con As New ADODB.Connection
    Dim rst As New ADODB.Recordset
   
    If rst.State <> adStateOpen Then
        rst.CursorLocation = adUseClient
        con.Open ("Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\My_Space\db1.mdb")
        rst.Open "SELECT * FROM MyDOB", con, , adLockOptimistic
    End If
   
    Dim strFind As String
    If Not (rst.BOF Or rst.EOF) Then
        strFind = "ADDRESS='" & Me.ADDRESS & "'"
        rst.MoveFirst
        rst.Find strFind
        If Not rst.EOF Then
            Debug.Print "Record found"
        Else
            Debug.Print "Record not found"
        End If
    End If
   
    rst.Close
    Set rst = Nothing
    con.Close
    Set con = Nothing

End Sub

PS: Just make sure that your searched string is correct and add Me.ADDRESS.Text if it is a text box. By the way what is this control?

Thanks
0
 
cellorandoAuthor Commented:
None of the comments helped me unfortunately.  I was hoping someone had run into the problem.  I was probably supposed to put the question into the DB/Access instead of programming. Lean's link to www.activeserverpages.ru is a useful one.

I have dupmed the code entirely and am finished a completely different module which I had already started.
0
 
GrahamSkanCommented:
Very generous, in the curcumstances
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now