Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2006, 07:09 AM
Authorized User
 
Join Date: May 2006
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page Count problem

Hi,
I'm having difficulty in displaying records on the next page(s). The resultsearch.asp:[code]
'connection & dims all above - not shown
Set myRS = Server.CreateObject("ADODB.Recordset")
myRS.CursorLocation = 3 ' adUseClient
myGen = Request("gender")
myMin = CInt(Request("minAge"))
myMax = CInt(Request("maxAge"))
mySort = Request("sort")

IF myGen = "brother" THEN
mySQLb = "SELECT * From tbl_brother WHERE BrAge >='" & myMin & "' AND BrAge <='" & myMax & "'"
mySQLb = mySQLb & " ORDER BY BrAge " & mySort
myRS.Open mySQLb, myCon,3,3,1
ELSE
mySQLs = "SELECT * From tbl_sister WHERE SrAge >='" & myMin & "' AND SrAge <='" & myMax & "'"
mySQLs = mySQLs & " ORDER BY SrAge " & mySort
myRS.Open mySQLs, myCon,3,3,1
END IF
myCount = myRs.RecordCount

myRS.PageSize = 3 'just testing
intPageCount = myRS.PageCount

Select Case Request("Action")
    case "<<"
        intpage = 1
    case "<"
        intpage = Request("intpage")-1
        if intpage < 1 then intpage = 1
    case ">"
        intpage = Request("intpage")+1
        if intpage > intPageCount then intpage = IntPageCount
    Case ">>"
        intpage = intPageCount
    case else
        intpage = 1
end select
%>
(HTML bits here...)

        <%
Select Case myGen
        Case "brother" %>
        
         <% Case "sister" %>
        
         <% Case Else
         Response.write "Please check your selection and try again"
        end Select %>

The navigation at the bottom:
Code:
<form name="MovePage" action="searchresults.asp" method="post">
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type="submit" name="action" value="<<">
<input type="submit" name="action" value="<">
<input type="submit" name="action" value=">">
<input type="submit" name="action" value=">>">
Page: <%=Intpage & " of " & intpagecount%>
</form>

Following is the tableBro.asp file (SSI):
Code:
<% myRS.AbsolutePage = intPage
  For intRecord=1 To myRS.PageSize %>
    <td><a href="detail.asp?id=<%= myRS("Br_ID") %>"><%="BR" & Right("0000" & myRS("Br_ID"), 4)%></a></td>
    <td><%= myRS("BrAge")%></td>
    <td><%= LCase(myRS("BrStatus"))%></td>
  </tr>
  <%
  myRS.MoveNext
    If myRS.EOF Then Exit For 
    Next
      myRS.Close
      Set myRS=Nothing
      myCon.Close
      Set myCon=Nothing
      %>
The 1st page displays the results but when going fwd, there are no results showing, & same when coming back(<).

Struggling here :( , need some help please...TIA.
Hope to hear...
 
Old July 20th, 2006, 02:32 AM
Authorized User
 
Join Date: May 2006
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,
Anyone home? :D






Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Count kondapally Crystal Reports 0 April 13th, 2006 02:29 PM
is there any in built function to count page count g.tamilselvan MySQL 1 February 15th, 2006 07:43 AM
Page count goLynxgo Excel VBA 3 January 24th, 2005 01:52 PM
Total Page Count denis74hd Crystal Reports 4 May 27th, 2004 02:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.