Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL and Ado recordset .... issues

Author  Topic 

afterburn
Starting Member

28 Posts

Posted - 2003-01-17 : 20:46:53
I have a paging stored procedure just like the link here

[url]http://www.15seconds.com/issue/010308.htm[/url]

however the paging is failing. Seems the recordset is failing and is closed. However the SP returns 0 if successfully completed or @@Error otherwise.

ADO Code below fails to create open the recordset

<%@ Transaction=required EnableSessionState=False Language=VBScript %>
<%Option Explicit
Response.Buffer = true

dim conn,rs,cmd,PageStart

PageStart = Request.QueryString("PageStart")
if not isNumeric(PageStart) or PageStart = "" then
PageStart = 1
else
PageStart = CSng(PageStart)
end if

SET conn = server.CreateObject("adodb.connection")
set rs = server.CreateObject("adodb.recordset")
set cmd = server.CreateObject("adodb.command")


With conn
.ConnectionString = Application("Conn")
.CursorLocation = adUseClient
.Open
End With

With rs
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockReadOnly
End With

With cmd
.ActiveConnection = Conn
.CommandText = "spAdminGetOrders"
.Parameters.Append .CreateParameter("@State",adInteger,adParamReturnValue)
.Parameters.Append .CreateParameter("@Page",adInteger,adParamInput,4,PageStart)
.Parameters.Append .CreateParameter("@Size",adInteger,adParamInput,4,25)
.CommandType = adCmdStoredProc
set rs = .Execute

End With
Response.Write rs.State


%>




afterburn
Starting Member

28 Posts

Posted - 2003-01-17 : 21:55:23
Nevermind it was a
set nocount on
set nocount off

issue.

Go to Top of Page
   

- Advertisement -