%
Dim strLoc, RS, intPage, intPageCount, intRecordCount, intRecord
If Request("loc") = "" Then
strLoc = 1
Else
strLoc = Request("loc")
End If
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open "Select id, address1, address2, city, targetstate, zip, beds, bath, comments, listingdate, price, pic1, sqft, lotsize from listing Where location="& strLoc &" ORDER BY listingdate DESC", Conn, 1, 2
' Check to see if there is value in the NAV querystring. If there
' is, we know that the client is using the Next and/or Prev hyperlinks
' to navigate the recordset.
If Request.QueryString("NAV") = "" Then
intPage = 1
Else
intPage = Request.QueryString("NAV")
End If
' Set the PageSize, CacheSize, and populate the intPageCount and
' intRecordCount variables.
Rs.PageSize = 10
' The cachesize property sets the number of records that will be cached
' locally in memory.
RS.CacheSize = Rs.PageSize
intPageCount = Rs.PageCount
intRecordCount = Rs.RecordCount
' Now you must double check to make sure that you are not before the start
' or beyond end of the recordset. If you are beyond the end, set
' the current page equal to the last page of the recordset. If you are
' before the start, set the current page equal to the start of the recordset.
If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount
If CInt(intPage) <= 0 Then intPage = 1
' Make sure that the recordset is not empty. If it is not, then set the
' AbsolutePage property and populate the intStart and the intFinish variables.
If intRecordCount > 0 Then
Rs.AbsolutePage = intPage
End If
%>
Search Results for:
<% getCurrentArea(strLoc) %>
<%
If RS.Eof Then
response.write "No houses are found. Please run your search again."
Else
%>
Your search has
returned <%= intRecordCount %> homes.
<% For intRecord = 1 to rs.pagesize
If rs.eof then exit for
%>
Description:
<% If RS("comments") <> "" then
cropme RS("comments"), RS("ID"), 200, "true"
Else
response.write "Currently no information is available."
End If
%>
<%
RS.MoveNext
Next
%>
<%
' Check to see if the current page is greater than the first page
' in the recordset. If it is, then add a "Previous" link.
If cInt(intPage) > 1 Then
Response.Write "<< Prev"
End IF
Response.Write " Page "& intpage &" of "& intPageCount &" "
' Check to see if the current page is less than the last page
' in the recordset. If it is, then add a "Next" link.
If cInt(intPage) < cInt(intPageCount) Then
Response.Write "Next >>"
End If
%><%
End If
%>