Copy Code code as follows:
<%
Page=trim (Request ("page")
Maxperpage=40
First=true
Last=true
Dim rs
Set Rs=server. CreateObject ("Adodb.recordset")
Sql= "Select Id,title,add1,cartype,isred,enterdate,hits from Newnews where classtype=0 and Pass=1 order by id DESC"
Rs.Open sql,conn,1,1
Rs.pagesize=maxperpage
Totalpage=rs.pagecount
If Len (page) =0 Then
Intpage=1
First=false
Else
If CInt (page) <=1 Then
Intpage=1
First=false
Else
If CInt (page) >=rs.pagecount Then
Intpage=rs.pagecount
Last=false
Else
Intpage=cint (page)
End If
End If
End If
If not rs.eof then
Rs.absolutepage=intpage
End If
For A=1 to Maxperpage
If Rs.eof then exit for
%>
<tr <%if (a mod 2) =0 Then
Response.Write "Bgcolor= #ffffff"
Else
Response.Write "Bgcolor= #f6f6f6"
End If
%>>
<TD height= "><div" align= "center" ><%=a%></div></td>
<td><div align= "center" >
<%add=rs ("Add1")
Substring add,4
%>
</div></td>
<td>
<a href= "displaynews.asp?id=<%=rs (" id ")%>" target= "_blank" >
<%
If RS ("isred") =true Then
%>
<font color= "Red" >
<%title=rs ("title")
Substring title,20
%></font>
<%else
Title=rs ("title")
Substring title,20
%>
<%
End If
%>
</a></td>
<td><div align= "Center" ><%=rs ("Cartype")%></div></td>
<td><div align= "center" >
<%thetime=rs ("Enterdate")
Themon=datepart ("M", Thetime)
If Len (Themon) <2 then themon= "0" &themon
Theday=datepart ("D", Thetime)
If Len (theday) <2 then theday= "0" &theday
ther=themon& "-" &theday
Response.Write Ther
%>
</div></td>
<td><div align= "Center" ><%=rs ("hits")%></div></td>
</tr>
<%
Rs.movenext
If Rs.eof then exit for
Next
%>
</table>
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<TD height= "5" ></td>
</tr>
</table>
<table width= "100%" border= "0" cellpadding= "0" cellspacing= "0" >
<tr>
<TD height= bgcolor= "#f6f6f6" >
<div align= "center" >
<%if Rs.pagecount>0 then%>
Total <%=rs.recordcount%> | current page <%=intpage%>/
<%
=rs.pagecount%>
<% End If%>
<%if intpage>1 then%>
<a href= "<%request. ServerVariables ("Script_name")%>?
Page=1 "> Home </a>
<%else%>
Home
<%end if%>
<%if-Then%>
<a href= "<%request. ServerVariables ("Script_name")%>?
Page=<%=intpage-1%> "> Prev </a>
<%else%>
Previous page
<%end if%>
<%if Last and Intpage<rs.pagecount then%>
<a href= "<%request. ServerVariables ("Script_name")%>?
Page=<%=intpage+1%> "> next page </a>
<%else%>
Next page
<%end if%>
<%if Intpage<rs.pagecount then%>
<a href= "<%request. ServerVariables ("Script_name")%>?
Page=<%=rs.pagecount%> "> End </a>
<%else%>
Last
<%end if%>
Go to
<select onchange= "Location=this.options
[This.selectedindex].value ">
<%for B=1 to Rs.pagecount
If B=intpage then%>
<option value= "<%request. ServerVariables ("Script_name")%>?page=<%=b%> "selected>
Page <%=b%> </option>
<% Else%>
<option value= "<%request. ServerVariables ("Script_name")%>?page=<%=b%> "> <%=b%> page
</option>
<%end if
Next%>
</select>
</div></td>
</tr>
</table>
</body>
<%
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
%>