Hi all,
I am trying to use the RecordSet.PageCount property with a SQL Server 7.0
Stored Procedure and it doesn't seem to be working. Is this property
available when using stored procedures? I want to display 5 records from
the recordset and allow the user to press a "Next" link for the next 5
records, or "Previous" for the previous page.
Here is my code: (I'm using Javascript here instead of VBScript)
-------------------------------------------------------------------
var iPageSize;
var iPageCount;
var iPageCurrent;
var myConn;
var myCmd;
var myRecSet;
var lngRecs;
var gVar = Request("Var");
iPageSize = 5
myConn = Server.CreateObject("ADODB.Connection");
myCmd = Server.CreateObject("ADODB.Command");
myRecSet = Server.CreateObject("ADODB.Recordset");
myRecSet.PageSize = iPageSize; //set the page size
myRecSet.CacheSize = iPageSize;
myConn.ConnectionTimeout = Application("oDB_ConnectionTimeout");
myConn.CommandTimeout = Application("oDB_CommandTimeout");
myConn.CursorLocation = Application("oDB_CursorLocation");
myConn.Open(Application("oDB_ConnectionString"),Application("oDB_RuntimeUserName"),Application("oDB_RuntimePassword"));
myCmd.ActiveConnection = myConn;
myCmd.CommandText = "sp_Search";
myRecSet = myCmd.Execute(lngRecs, gVar, adCmdStoredProc);
iPageCount = myRecSet.PageCount;
------------------------------------------------------------------------
I also tried to use the lngRecs variable but it isn't returning a value:
iPageCount = (lngRecs/5);
Any help here would be appreciated!
Thanks
Michael