67 views
Next
<%
pageSize = 25
if(len(Request.QueryString("page"))=0)then
currentPage = 1
else
currentPage = CInt(Request.QueryString("page"))
end if
If Not IsNumeric (currentPage) Then currentpage = 1
If currentPage < 1 Then currentPage = 1
start = ((currentPage - 1) * pageSize)
If start < 0 Then start = 0
%>
<% SQL = "SELECT * FROM _myTbl LIMIT " & start & ", " & pageSize %>
<% Set RS = Server.CreateObject("ADODB.Recordset") %>
<% RS.Open SQL, cn %>
<% if Not RS.eof then %>
<% while not RS.eof %>
<% RS.movenext() %>
<% wend %>
<% end if %>
<% RS.Close() : Set RS = Nothing %>
<% if currentPage > 1 then %>
Prev
<% else %>
Prev<% end if %>
|
<% if cInt(start) <> cInt(pageSize) then %>
Next
<% else %>
Next
<% end if %>