Hi
With the code below I want to page thru the recordset (page by page). I create the disconnected recordset in COM and send the data back to ASP.
Do someone know why all records are returned each time instead of just one page?
Also, it works fine if I don't return it back to ASP and iterate it directly from the component!
Public Function AbsolutePageX(ByVal curpage As Integer, ByVal PageSize As Integer, ByVal getusers_ID As Integer) As ADODB.Recordset
Dim objContext As COMSVCSLib.ObjectContext
Dim objRS As ADODB.Recordset
Dim strSQL As String
On Error GoTo Error_Handler
' Get a reference to the context object
Set objContext = GetObjectContext()
Set objRS = New ADODB.Recordset
' Use client cursor to enable AbsolutePosition property.
objRS.CursorLocation = adUseClient
strSQL = "Select ..."
objRS.Open strSQL, sConnect, adOpenForwardOnly
objRS.PageSize = CInt(PageSize)
objRS.AbsolutePage = CInt(curpage)
Set AbsolutePageX = objRS ' Set the return value
Set objRS.ActiveConnection = Nothing
' Everything worked
If Not objContext Is Nothing Then objContext.SetComplete
Exit_Handler:
' Clean up
Set objRS = Nothing
Set objContext = Nothing
Exit Function
Error_Handler:
Resume Exit_Handler
End Function
_________________
ASP COde:
<%
Set objRS = objASPTrans.AbsolutePageX(1, 5, Cint(owner))
For intRecord = 1 to objRS.PageSize
...
Next
%>
With the code below I want to page thru the recordset (page by page). I create the disconnected recordset in COM and send the data back to ASP.
Do someone know why all records are returned each time instead of just one page?
Also, it works fine if I don't return it back to ASP and iterate it directly from the component!
Public Function AbsolutePageX(ByVal curpage As Integer, ByVal PageSize As Integer, ByVal getusers_ID As Integer) As ADODB.Recordset
Dim objContext As COMSVCSLib.ObjectContext
Dim objRS As ADODB.Recordset
Dim strSQL As String
On Error GoTo Error_Handler
' Get a reference to the context object
Set objContext = GetObjectContext()
Set objRS = New ADODB.Recordset
' Use client cursor to enable AbsolutePosition property.
objRS.CursorLocation = adUseClient
strSQL = "Select ..."
objRS.Open strSQL, sConnect, adOpenForwardOnly
objRS.PageSize = CInt(PageSize)
objRS.AbsolutePage = CInt(curpage)
Set AbsolutePageX = objRS ' Set the return value
Set objRS.ActiveConnection = Nothing
' Everything worked
If Not objContext Is Nothing Then objContext.SetComplete
Exit_Handler:
' Clean up
Set objRS = Nothing
Set objContext = Nothing
Exit Function
Error_Handler:
Resume Exit_Handler
End Function
_________________
ASP COde:
<%
Set objRS = objASPTrans.AbsolutePageX(1, 5, Cint(owner))
For intRecord = 1 to objRS.PageSize
...
Next
%>