Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004

    Question Unanswered: Rowset does not support fetching backward.

    I'm having an issue with returning the recordset back from a stored procedure. I'm using an MTS component (VB), using ADORecordset 2.6 Library, to run a stored procedure in MS SQL Server 7.0. The Recordcount always returns as -1 and the the movelast method fails with error
    "Rowset does not support fetching backward." Below is a portion of the VB code. The Stored Procedured does contain the SET NOCOUNT ON statement.

    Set conn = New ADODB.Connection
    20 conn.ConnectionTimeout = 90
    30 conn.CommandTimeout = 60

    'Open the connection
    40 conn.Open ConnectionString

    50 Set rs = New ADODB.Recordset

    60 rs.CacheSize = PageSize
    70 rs.PageSize = PageSize
    80 rs.CursorLocation = adUseServer
    90 rs.CursorType = adOpenStatic
    100 rs.LockType = adLockReadOnly
    110 Set rs.ActiveConnection = conn

    120 rs.Open SQLStr

    I found the following two kB articles, but neither explains how to solve the problem. Any experience or ideas with this?;en-us;306388;en-us;194973

  2. #2
    Join Date
    Mar 2004
    Try specifying that it is a stored-procedure like this:

    rs.Open strSQL, cn, adOpenStatic, adLockReadOnly, adCmdStoredProc

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  3. #3
    Join Date
    Oct 2003
    It doesn't surprise me that a stored procedure would not support "moving backward."
    ChimneySweep(R): fast, automatic
    table repair at a click of the

  4. #4
    Join Date
    Jun 2004
    Arizona, USA
    It looks like all the settings are correct.

    The data source (Table or stored procedure) has nothing to do with the recordset movement. Naturally, a stored procedure will not allow edits of the underlying data, but a static recordset should allow movement in both directions.

    You will always get a record count = -1 when the cursorlocation is adUseServer.
    Last edited by loquin; 08-24-04 at 18:41.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

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