asp分页(自己整理的2个分页程序)(2)
<input name="page" value="<%=epage%>" maxlength=5 tyep=text />
页
<input type=submit value=GO style="font-size:12px;border:1px solid #CCCCCC;width:23px;" /></form>
</div>
<p> </p>
<p>
<%
name=request("name")
pass=request("pass")
if name<>"" and pass<>"" then
rs.Addnew
rs("name")=name
rs("pass")=pass
rs.update
rs.close
end if
%>
</p>
</p>
<form id="form1" name="form1" method="post" action="">
<p>
<input name="name" type="text" id="name" />
</p>
<p>
<input name="pass" type="text" id="pass" />
<input type="submit" name="Submit" value="提交" />
</p>
</form>
<p>
<table width="63%" border="0" cellpadding="0" cellspacing="1" bgcolor="#0000FF" style="border-collapse: collapse">
<%
set mrs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("zheng.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from user"
mrs.open sql,conn,1,1
If mRs.bof and mRs.eof then
Response.Write"<span>没有任何记录</span>"
Response.End
Else
mRs.PageSize =6'每页记录条数
iCount=mRs.RecordCount '记录总数
iPageSize=mRs.PageSize
maxpage=mRs.PageCount
page=request("page")
If Not IsNumeric(page) or page="" then
page=1
Else
page=cint(page)
End If
If page<1 then
page=1
ElseIf page>maxpage then
page=maxpage
End If
mRs.AbsolutePage=Page
If page=maxpage then
x=iCount-(maxpage-1)*iPageSize
Else
x=iPageSize
End If
End If
for i=1 to mRs.pagesize
%>
<tr>
<td width="64%" bgcolor="#FFFFFF" class="STYLE1"><%=mrs("name")%></td>
内容版权声明:除非注明,否则皆为本站原创文章。