If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Rowset does not support fetching backward.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-23-04, 13:22
remmac remmac is offline
Registered User
 
Join Date: Aug 2004
Posts: 1
Question 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?

http://support.microsoft.com/default...b;en-us;306388
http://support.microsoft.com/default...b;en-us;194973
Reply With Quote
  #2 (permalink)  
Old 08-23-04, 22:09
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Try specifying that it is a stored-procedure like this:

Code:
rs.Open strSQL, cn, adOpenStatic, adLockReadOnly, adCmdStoredProc
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

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!
Reply With Quote
  #3 (permalink)  
Old 08-24-04, 10:38
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
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
mouse! http://www.sundialservices.com
Reply With Quote
  #4 (permalink)  
Old 08-24-04, 18:38
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
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.
__________________
Lou
使大吃一惊
"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


Last edited by loquin; 08-24-04 at 18:41.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On