#12005/3/26 8:25:28
<%@language=vbscript%>
<%
set conn=server.CreateObject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("info.mdb")
exec="select * from stu"
set rs=server.CreateObject("adodb.recordset")
rs.open exec,conn,1,1
rs.PageSize=3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
function pagefirst(){
document.myform.currentpage.selectedindex=0;
document.myform.currentpage.onchange();
}
function pagepre(){
document.myform.currentpage.selectedindex--;
document.myform.currentpage.onchange();
}
function pagenext(){
document.myform.currentpage.selectedindex++;
document.myform.currentpage.onchange();
}
function pagelast(){
document.myform.currentpage.selectedindex=document.myform.currentpage.length-1;
document.myform.currentpage.onchange();
}
function pagecurrent(){
document.myform.action='02.asp?page='+(document.myform.currentpage.selectedindex+1);
document.myform.submit();
}
</script>
</head>
<body>
<% if rs.eof then
response.Write("数据库无记录")
else
if request("currentpage")="" then
rs.absolutepage=1
else
rs.absolutepage=Clng(request("currentpage"))
end if
response.write("<form name=myform method=get>")
Response.Write("<p align=center><font size=2 color=#008000>")
if rs.pagecount=1 then
response.write("[第一页] [上一页] [下一页] [最后一页]")
else
if rs.absolutepage=1 then
response.write("[第一页] [上一页]")
response.write("[<a href=javascriptagenext()>下一页]")
response.write("[<a href=javascriptagelast()>最后一页]")
else
if rs.absolutepage=rs.pagecount then
response.write("[<a href=javascriptagefirst()>第一页]")
response.write("[<a href=javascriptagepre()>上一页]")
response.write("[下一页] [最后一页]")
else
response.write("[<a href=javascriptagefirst()>第一页]")
response.write("[<a href=javascriptagepre()>上一页]")
response.write("[<a href=javascriptagenext()>下一页]")
response.write("[<a href=javascriptagelast()>最后一页]")
end if
end if
end if
response.write("<select size=1 name=currentpage onchange=pagecurrent>")
for i=1 to rs.pagecount
if rs.absolutepage=i then
response.write("<option selected>"&i&"</option>")
else
response.write("<option>"&i&"</option>")
end if
next
Response.Write("</select>页/共"&rs.PageCount&"页 共"&rs.RecordCount&"条记录</font><p>")
response.write("</form>")
response.write("<table align=center cellspacing=1 cellpadding=1 border=1 bordercolor=#99CCFF>")
response.write("<tr>")
response.write("<td>"&"序"&"</td>")
response.write("<td>"&"名字"&"</td>")
response.write("<td>"&"地址"&"</td>")
response.write("<td>"&"E-mail"&"</td>")
response.write("</tr>")
for i=1 to rs.pagesize
response.write("<tr>")
response.write("<td>"&rs("id")&"</td>")
response.write("<td>"&rs("名字")&"</td>")
response.write("</tr>")
rs.movenext
if rs.eof then exit for
next
response.write("</table>")
end if
%>
</body>
</html>
怎么没办法实现上下页的链接??
是不是哪错?