"OpenWebDesign is highly addictive. Or have you got your own slogan?"

<% Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName SqlDatabaseName = "SEOEdu" SqlPassword = "Tempuser8898Tempuser%" SqlUsername = "Tempuser" SqlLocalName = "211.144.157.47" ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";" set Conn = server.CreateObject("ADODB.Connection") Conn.open Connstr set rs = server.CreateObject("adodb.recordset") SQL="Select * FROM ResourceLink where SrvFlag =1 Order By StarFlag DESC" Set rs=Server.CreateObject("Adodb.Recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then response.Write("
 暂无记录
") else dim MaxPageSize,rCount,PageNum,Dr,Rows,Url,PageCount1,i Url = "" MaxPageSize = 100 rCount = rs.recordcount If (rCount Mod MaxPageSize) = 0 Then PageCount1 = rCount \ MaxPageSize Else PageCount1 = (rCount \ MaxPageSize)+1 End If if request.querystring("page") = "" or CInt(request.querystring("page")) > PageCount1 then PageNum = 1 else PageNum = request.querystring("page") end if if PageNum>1 then rs.AbsolutePosition=rs.AbsolutePosition+((abs(PageNum)-1)*MaxPageSize) Dr = rs.GetRows(MaxPageSize) Rows = ubound(Dr,2) for i=0 to Rows 'Response.Write(dr(1,i)) Response.Write("") Next end if %>
<%=PageList(MaxPageSize,rCount,PageNum)%>
© 2005 -2009 Design by www.souenet.com
<% Function PageList(PageValue,RetCount,CurrentPage) Dim OutStr,i,XD_sURL Dim PageCount,PageRoot,PageFoot XD_sURL = GetUrl() '访止被0除 if PageValue = "" or PageValue = Empty then PageValue = 1 end if If (RetCount Mod PageValue) = 0 Then PageCount = RetCount \ PageValue Else PageCount = (RetCount \ PageValue)+1 End If If CurrentPage-5<=1 Then PageRoot = 1 Else PageRoot = CurrentPage-5 End If If CurrentPage+5>=PageCount Then PageFoot = PageCount Else PageFoot = CurrentPage+5 End If OutStr = "共 "&PageCount&" 页,当前为第 "&CurrentPage&" 页" If PageRoot=1 Then If CurrentPage=1 or RetCount=0 Then OutStr = OutStr&" 首页 " OutStr = OutStr&" 上一页" Else OutStr = OutStr&"" OutStr = OutStr&" 首页 " OutStr = OutStr&"" OutStr = OutStr&" 上一页 " End If Else '... OutStr = OutStr&"" OutStr = OutStr&" 首页" OutStr = OutStr&"" OutStr = OutStr&" 上一页" End If 'For i=PageRoot To PageFoot ' If i=Cint(CurrentPage) Then ' OutStr = OutStr&""&Cstr(i)&" " ' Else ' OutStr = OutStr&""&Cstr(i)&" " ' End If ' If i=PageCount Then Exit For ' Next If PageFoot=PageCount Then If Cint(CurrentPage)=PageCount Then OutStr = OutStr&" 下一页" OutStr = OutStr&" 尾页" Else OutStr = OutStr&"" OutStr = OutStr&" 下一页" OutStr = OutStr&"" OutStr = OutStr&" 尾页" End If Else '... OutStr = OutStr&"" OutStr = OutStr&" 下一页" OutStr = OutStr&"" OutStr = OutStr&" 尾页" End If OutStr = OutStr&"    " OutStr = OutStr&" 0 && document.all.PageNum.value<="&PageCount&"){window.location='"&XD_sURL&"'+document.all.PageNum.value}"&""""&" onmouseover='this.focus()' onfocus='this.blur()'>" PageList = OutStr End Function Private Function GetURL() Dim strurl,str_url,i,j,search_str,result_url,str_params search_str="page=" strurl=Request.ServerVariables("URL") Strurl=split(strurl,"/") i=UBound(strurl,1) str_url=strurl(i)'得到当前页文件名 str_params=Trim(Request.ServerVariables("QUERY_STRING")) If str_params="" Then result_url=str_url & "?page=" Else If InstrRev(str_params,search_str)=0 Then result_url=str_url & "?" & str_params &"&page=" Else j=InstrRev(str_params,search_str)-2 If j=-1 Then result_url=str_url & "?page=" Else str_params=Left(str_params,j) result_url=str_url & "?" & str_params &"&page=" End If End If End If GetURL=result_url End Function %>