<%
Dim fileName,postion,i
Dim pre,last,intpage,pageNo
Sub Page1()
'-------获取带参数的地址
Dim ScriptAddress,M_ItemUrl,M_item,GetUrl
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
M_ItemUrl = ""
If (Request.QueryString <> "") Then
ScriptAddress = ScriptAddress & "?"
For Each M_item In Request.QueryString
If M_Item<>"page" then
M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&"
End If
Next
end if
GetUrl = ScriptAddress & M_ItemUrl
if right(GetUrl,3)<>"asp" then
GetUrl=left(GetUrl,len(GetUrl)-1)
end if
fileName = GetUrl
if Instr(fileName,"?")>0 then
fileName=fileName&"&"
Else
fileNAme=fileName&"?"
end if
'-----结束

pre = true
last = true
'page = trim(Request.QueryString("page"))
pageNo = Request("page")
if len(pageNo) = 0 then
intpage = 1
pre = false
else
if cint(pageNo) =< 1 then
intpage = 1
pre = false
else
if cint(pageNo) >= oRs.PageCount then
intpage = oRs.PageCount
last = false
else
intpage = cint(pageNo)
end if
end if
end if
if not oRs.eof then
oRs.AbsolutePage = intpage
end if

End sub
Sub Page()
%>
<table width="100%" height="24" align="left" cellpadding="0" cellspacing="0">
<tr>
<%if oRs.pagecount > 0 then%>
<td width="13%" align="left" border="1" height="24">当前页<%=intpage%>/<%=oRs.PageCount%></td>
<%else%>
<td width="41%" align="left" height="24">当前页0/0</td><%end if%>
<td width="46%" align="right" height="24"> <a href="<%=fileName%>page=1">首页</a>| 
<%if pre then%>
<a href="<%=fileName%>page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="<%=fileName%>page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="<%=fileName%>page=<%=oRs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to oRs.PageCount
if i = intpage then%>
<option value="<%=fileName%>page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="<%=fileName%>page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font> 
</td>
</tr>
</table>
<%
End Sub
%>