Hej NG
Jeg har nogle problemer med Paging, jeg får vist udtræk fra
databasen, men mine link til de resterne sider virker ikke, er
der nogle der kan se hvad jeg har gjort forkert.
-----------------------------
<html>
<title>condo for rent Chiangmai</title>
<head>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
</style>
</head>
<body>
<%
intPage = Request("page")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
strMin = Request.Querystring("min_price")
strMax = Request.Querystring("max_price")
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "Select * from Condo where Rent=True And Price_rent > "
& strMin & " And Price_rent <= " & strMax & " Order By
Price_rent"
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
Server.MapPath("DB/Database3.mdb")
rs.Open strSQL, strDSN, 1
If rs.EOF Then
%>
<table border="0" cellpadding="0" cellspacing="0" style="width:
100%">
<tr>
<td width="14" height="45" bgcolor="#245C6B">
<img src="images/spacer.gif" width="14" height="45"></td>
<td width="15" background="images/bg_8.jpg">
<img src="images/spacer.gif" width="15" height="1"></td>
<td background="images/bg_8.jpg"><h1>Condo for rent</h1></td>
</tr>
</table>
<p ></p>
<p ></p>
<p ></p>
<p class="style1"><% Response.write "Sorry we do not have condos
between " & formatnumber(strMin,0) & " and " &
formatnumber(strMax,0) & " Bath/month" %></p>
<p ></p>
<p ></p>
<p ></p>
<%
End if
If Not (rs.BOF Or rs.EOF) Then
rs.PageSize = 10
rs.AbsolutePage = intPage
intRecCount = rs.PageSize
intPageCount = rs.PageCount
%>
<table border="0" cellpadding="0" cellspacing="0" style="width:
100%">
<tr>
<td width="14" height="45" bgcolor="#245C6B">
<img src="images/spacer.gif" width="14" height="45"></td>
<td width="15" background="images/bg_8.jpg">
<img src="images/spacer.gif" width="15" height="1"></td>
<td background="images/bg_8.jpg"><h1>Condo for rent - <%
Response.write formatnumber(strMin,0) & " and " &
formatnumber(strMax,0) & " Bath/month" %></h1></td>
</tr>
</table>
<p></p>
<p ></p>
<%
' Gennemløb Recordset (rs) med en løkke
Do While Not rs.EOF And intRecCount > 0
strNum = rs("Price_rent")
strID = rs("KundeID")
strLink = "<a href='condo_rent_full.asp?id=" & rs("ID") & "'>" &
strID & "</a>"
%>
<table style="width: 100%">
<tr>
<td colspan="6" class="style3"><%Response.Write strLink & " - "
& rs("Small_Description") %></td>
</tr>
<tr >
<td rowspan="4"> <% Response.Write "<img src=" & "Picture/" &
rs("Picture_1") & " width=" & """139""" & "height=" & """90""" &
">" %></td >
<td style="width: 91px" class="style2">Price</td>
<td style="width: 75px" class="style2">Condo size</td>
<td style="width: 69px" class="style2">Floor</td>
<td style="width: 69px" class="style2">District</td>
<td style="width: 89px" class="style2">moo baan</td>
</tr>
<tr>
<td style="width: 91px" class="style1"><% Response.Write
formatnumber(strNum,0) %> Bath/month</td>
<td style="width: 75px" class="style1"><% Response.Write
rs("condo_size") %> sq m</td>
<td style="width: 69px" class="style1"><% Response.Write
rs("Floor") %></td>
<td style="width: 69px" class="style1"><% Response.Write
rs("District") %></td>
<td style="width: 89px" class="style1"><% Response.Write
rs("Moobann") %></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5" style="height: 76px"><% Response.Write
rs("Description") %></td>
</tr>
</table>
<%
intRecCount = intRecCount - 1
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
%>
<table style="width: 100%">
<tr>
<td class="style1"><% If Clng(intPage) > 1 Then
Response.Write "<a href=condo_rent.asp?page=" & intPage - 1
& ">Previous </a>"
Else
Response.Write "Previous "
End If
For intNum = 1 To intPageCount
Response.Write "<a href=condo_rent.asp?page=" & intNum &
">" & intNum & "</a> "
Next
If Clng(intPage) < Clng(intPageCount) Then
Response.Write "<a href=condo_rent.asp?page=" & intPage +
1 & "> Next</a> "
Else
Response.Write " Next"
End If %></td>
</tr>
<tr>
<td class="style1"><% Response.Write "<p>Page " & intPage & "
af " & intPageCount & "</p>" %></td>
</tr>
</table>
</body>
</html>
-----------------------
/Claus Ørnskov
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials