<% 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 %>
 Address  Beds  Baths  Sq. ft.  Lot Size  Listing Date  Price
  "> <% Dim strTemp strTemp = RS("address1") &", "& RS("city") &", "& RS("targetstate") &" "& RS("zip") cropme strTemp, RS("ID"), 25, "false" %> <%if datediff("d",rs("listingdate"), now) < 5 then %> <% End If %> <%IF NOT ISNULL(RS("beds")) THEN RESPONSE.WRITE RS("beds") %> <%IF NOT ISNULL(RS("bath")) THEN RESPONSE.WRITE RS("bath") %> <% If RS("sqft") <> "" Then %> <%= RS("sqft") %> <% Else %> N/A <% End If %> <%IF NOT ISNULL(RS("lotsize")) THEN RESPONSE.WRITE RS("lotsize") %> Sq. Ft. <%IF NOT ISNULL(RS("listingdate")) THEN RESPONSE.WRITE formatdatetime(RS("listingdate"),2) %> <%IF NOT ISNULL(RS("Price")) THEN RESPONSE.WRITE formatcurrency(RS("price")) %>
<% If IsNull(RS("pic1")) Then %>
Waiting for
photo from
seller's agent
.


<% Else %>
" name="imgchange" vspace="10">
<% End If %>
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 %>