一种很好的分页方法,删除数据的方式(带确实和取消窗口),搜索关键字(含空格)的处理-ASP教程,数据
<!-- #include file="connect.asp" --><%
Keyword=request("Keyword")
Keyword=replace(Keyword," ","")
page = Request.QueryString("page")
sql="select * from 试卷信息 where 试卷名称 like '%"&keyword&"%'"
rs.open sql,conn,1,1
dim page,maxPerPage
maxPerPage=2 '每页显示的记录数
rs.pagesize=MaxPerPage
if (page="" or isempty(page)) then page=1
thisUrl="2.asp?Keyword="&Keyword
session("adminOldUrl")=thisUrl&"&page="&page
%>
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function jumpTo(i){
if(i==1){
this.document.location="<%=thisUrl%>";}
if(i==2){
this.document.location="<%=thisUrl%>&page=<%=page-1%>";}
if(i==3){
this.document.location="<%=thisUrl%>&page=<%=page+1%>";}
if(i==4){
this.document.location="<%=thisUrl%>&page=<%=rs.pageCount%>";}
}
// -->
</script>
<form method="post" action="2.asp">
<input type="text" name="keyword" size=57 value="" maxlength="50" style="width: 390; height: 20">
<input type="submit" name="Sub" value=" 查 询 "></td></form>
补充:asp教程,数据库相关