PRB: Errors Occur with Forward-Only Server-Side Cursor When You Use ADO Recordset Find (294139)



The information in this article applies to:

  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6
  • Microsoft Data Access Components 2.7

This article was previously published under Q294139

SYMPTOMS

When you use the adUseServer cursor location with the default Firehose cursor (Forward-Only, Read-Only cursor), the following error is generated when you use the Recordset.Find command:
Run-time error '-2147217879 (80040e29)': Rowset does not support scrolling backward.

RESOLUTION

Use the client-side cursor location, so that a Static cursor is created, which allows backward scrolling. You can use the server-side static/keyset/dynamic cursor, but you cannot use the server-side Forward-Only cursor in this scenario, because it does not support backward scrolling.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

Use the following Microsoft Visual Basic code to reproduce this problem. Make sure that Microsoft ActiveX Data Objects is selected in the Project ... References dialog box. This code connects to a SQL Server database.
Private Sub cmdTestIt_Click()
  Dim cn As New ADODB.Connection
  Dim rs As New ADODB.Recordset
  Dim txtID As String
   
  cn.ConnectionString = "provider=sqloledb;data source=YourSQLServer;initial catalog=northwind;User ID=YourUserID;Password=YourPassword"

  ' Uncomment the line below to correct the problem
  ' cn.CursorLocation = adUseClient
  cn.Open
    
  Set rs = cn.Execute("SELECT * FROM Customers")
  rs.Find "CustomerID='" & rs!CustomerID & "'"
  Debug.Print rs.EOF
  rs.Close
  cn.Close
End Sub
				

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbDatabase kbprb KB294139