asp分页程序及包含替换文件

 '取得传值变量
on error resume next
pageno=request("pageno")
if pageno="" then
  pageno=1
else
  pageno=cint(request("pageno"))
end if
exec="select * from fagui"
set rs=server.CreateObject("ADODB.recordset")
rs.open exec,cn,3,1
if rs.recordcount=0 then
response.write"没有找到您的记录,请重新查找"
else
rs.pagesize=20
rs.absolutepage=pageno
totalpage=int(rs.recordcount/rs.pagesize)
if rs.recordcount mod rs.pagesize <> 0 then
totalpage=totalpage+1
end if
response.write "<table border=0 width=100% ><tr><td align='center'>"
response.write "共找到<font color='#cc0000'>" & rs.recordcount & "</font>条记录,"
response.write "共<font color='#cc0000'>" & totalpage & "</font>页,"
response.write "这是第<font color='#cc0000'>" & pageno & "</font>页<br><br></td></tr>"
 i=0
do while not rs.eof and i<rs.pagesize
  response.write "<tr><td><img src='image/dian.gif'>&nbsp;<a href=chaxunxiangxi.asp?id=" & rs("id") & " target='_blank' class='title'>" & rs("name") & "</a>"
  response.write "</td></tr>"
  i=i+1
  rs.movenext
loop
response.write"</table>"
'确定分页     
response.write "<table border=0 width=100% >"
response.write"<tr><td align='center'>"
if pageno<>1 then
  response.write"<a href='mguanjianzi.asp?pageno=" & (pageno-1) & "' class='title'><font color='#0000cc'>上一页</font></a>&nbsp;&nbsp;"
  response.write "<a href='mguanjianzi.asp?pageno=1"&"' class='title'><font color='#0000cc'>第一页</font></a>&nbsp;&nbsp;"
end if
 
if pageno<>totalpage then
 response.write"<a href='mguanjianzi.asp?pageno=" & (pageno+1) & "' class='title'><font color='#0000cc'>下一页</font></a>&nbsp;&nbsp;"
 response.write"<a href='mguanjianzi.asp?pageno=" & totalpage & "' class='title'><font color='#0000cc'>最后一页</font></a>"
end if
response.write "</td></tr></table>"
response.write"<table border=0 width=100% ><tr><td align=right>"

rs.close
cn.close
set rs=nothing
set cn=nothing

包含:

<%
application("wt")="Driver={SQL Server};Server=127.0.0.1;Database=114;uid=114;pwd=6088;"
set cn=server.CreateObject("ADODB.Connection")
cn.Open application("wt")
'cn.open"dsn=zczx;uid=;pwd="
'set conn=server.createobject("adodb.connection")
'DBPath = Server.MapPath("/data/db1.mdb")
'cn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath

function changechr(str)
  changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;")  
  changechr=replace(replace(replace(replace(changechr,"[img]","<img src="),"[b]","<b>"),"[red]","<font color=CC0000>"),"[big]","<font size=7>")  
  changechr=replace(replace(replace(replace(changechr,"[/img]","></img>"),"[/b]","</b>"),"[/red]","</font>"),"[/big]","</font>")  
end function  

function dealinput(exp1)
dim exp2
exp2=replace(exp1,"<","&lt;")
exp2=replace(exp2,">","&gt;")
exp2=replace(exp2,"'","""")
dealinput=exp2
end function
%>

阅读更多
上一篇常用电脑资料速查
下一篇asp中用户注册时候js对输入框的验证
想对作者说点什么? 我来说一句

asp分页程序

2008年06月17日 11KB 下载

很好用的asp分页程序

2012年06月27日 40KB 下载

asp分页程序不错11

2008年10月03日 568KB 下载

ASP 百万数据分页程序

2010年12月29日 1.5MB 下载

asp分页程序_page

2012年12月05日 1KB 下载

没有更多推荐了,返回首页

关闭
关闭