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...