ASP Paging (MS SQL)

Results 1 to 2 of 2

Thread: ASP Paging (MS SQL)

  1. #1
    Join Date
    Dec 1969

    Default ASP Paging (MS SQL)

    I have some problems connecting to to my Microsoft SQL Server 2000. I&#039;m doing ADO Paging to separate results into several pages. I&#039;ve got the code below from google and was trying to modify it to suit my program. When i do a check for <BR><BR>Response.write rs.Pagesize<BR>or<BR>Response.write rs.Count <BR><BR>it will return -1<BR><BR>========================================= =======================<BR><BR><BR>Sql = "SELECT IDX, CLIENTIDX, COMPANY FROM CL_ADDRESSES WHERE CLIENTIDX= &#039;" & Session.Contents("clientidx") & "&#039; ORDER BY COMPANY"<BR> <BR>rs.CursorLocation = 3<BR>rs.CursorType = 3 <BR> <BR>rs.ActiveConnection = Session("Conn")<BR>set rs = Session("Conn").Execute(Sql)<BR><BR>rs.PageSize = 20<BR>rs.CacheSize = rs.PageSize<BR>intPageCount = rs.PageCount <BR>intRecordCount = rs.RecordCount <BR><BR> If CInt(intPage) &#062; CInt(intPageCount) Then intPage = intPageCount<BR> If CInt(intPage) &#060;= 0 Then intPage = 1<BR> <BR> If intRecordCount &#062; 0 Then<BR> rs.AbsolutePage = intPage<BR> intStart = rs.AbsolutePosition<BR> If CInt(intPage) = CInt(intPageCount) Then<BR> intFinish = intRecordCount<BR> Else<BR> intFinish = intStart + (rs.PageSize - 1)<BR> End if<BR> End If<BR> <BR> If RS.EOF Then<BR> RS.Close<BR> Response.Write "No Items found."<BR> ELSE<BR> ...<BR> ....<BR> End if<BR><BR>======================================== ========================<BR>I had placed the connection portion in global.asa on the Session_onstart event.<BR>Could anyone advise me on this? Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default Actaully I have a better one

    Hmmm (I&#039;m waiting for the sarchasm!)<BR>Truly it is proven and working on a live site so that must count for something...<BR>I&#039;ll post it to you tomorrow... ehhh today later that is

Posting Permissions

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