Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q294139

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


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
				

↑ Back to the top


Keywords: KB294139, kbprb, kbdatabase

↑ Back to the top

Article Info
Article ID : 294139
Revision : 3
Created on : 5/12/2003
Published on : 5/12/2003
Exists online : False
Views : 406