</head>
<body>
<%
const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPage
dim i,j
if not isempty(request("Page")) then
currentPage=cint(request("Page"))
else
currentPage=1
end if
set conn=Server.CreateObject("ADODB.connection")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from sz_speak"
conn.open "dsn=student;uid=sa;pwd=sa"
rs.open sql,conn,1,1
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if(currentpage-1)*Maxpege>totalput then
if(totalPut mod MaxPerPage)=0 then
currentpage=totalPut\ MaxPerPage
else
currentpage=totalPut\MaxPerPage+1
end if
end if
if currentpage=1 then
showpage totalput,MaxPerPage,"admini.asp"
showContent
showpage totalput,MaxPerPage,"admini.asp"
else
if(currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"admini.asp"
showContent
showpage totalput,MaxPerPage,"admini.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"admini.asp"
showContent
showpage totalput,MaxPerPage,"admini.asp"
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%>
<form method="post" action="del.asp">
<div align="justify">
<p align="center"><i><b><font face="Arial, Helvetica, sans-serif" size="2" color="#808080"></font></b></i></p>
<%do while not rs.eof%>
<table border="0" width="502" height="13" bgcolor="#FFFFFF" align="center">
<tr bgcolor="#B4ECF8">
<td width="38" height="18">
<table width="35" border="0" cellspacing="0" cellpadding="0" name="table">
<tr>
<td width="35">
<input type="checkbox" name="checkbox" value= "<% =rs("id") %>" >
<p>
</td>
</tr>
</table>
</td>
<td width="454" height="18">
<%
response.write"ÁôÑÔÕßÐÕÃû£º"&rs("name")&""
response.write"ÁôÑÔʱ¼ä£º"&rs("logtime")&"<BR>"
response.write"ÁôÑÔÖ÷Ì⣺"&rs("topic")&"<BR>"
response.write"ÁôÑÔÄÚÈÝ£º"&rs("content")&"<BR>"
%>
</td>
</tr>
</table>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop %>
<p align="center"> <font face="»ªÎÄÐп¬">
<input type="submit" name="Submit" value="ɾ³ý">
<input type="reset" name="reset" value="ÖØÖÃ">
<input name="Submit2" type="submit" onClick="window.open('showpp.asp','','width=200,height=200')" value="ÏÔʾ" >
</font> </div>
</form>
<%end sub %>
<%
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n=totalnumber\maxperpage
else
n=totalnumber\maxperpage+1
end if
response.write"<form method=Post action="&filename&" name=aaa>"
response.write"<p align='center'>>>·ÖÒ³ "
if CurrentPage<2 then
response.write"<font color='9999966'>Ê×Ò³ ÉÏÒ»Ò³</font> "
else
response.write"<a href="&filename&"?page=1&>Ê×Ò³</a> "
response.write"<a href="&filename&"?page="¤tPage-1&">ÉÏÒ»Ò³</a> "
end if
if n-currentpage<1 then
response.write"<font color='999966'>ÏÂÒ»Ò³ βҳ</font>"
else
response.write"<a href="&filename&"?page="¤tPage+1&">ÏÂÒ»Ò³</a> "
response.write"<a href="&filename&"?page="&n&">βҳ</a>;"
end if
response.write"Ò³´Î <strong><font color=red>"¤tPage&"</font>/"&n&"</strong>Ò³"
response.write"תµ½:<input type='text' name='page' size=4 maxlength =10 class=smallInput value="¤tpage&" >"
response.write"<input class=buttonface type='submit' value='Goto' name='cndok' ></span></p></form>"
end function
%>
</body>
</html>
以前写的,没有问题
<%
dim oconn,strsql,table,rsresult,objcmdcount,strparameter1,strparameter2
myself=request.servervariables("script_name")
set oconn=server.createobject("adodb.connection")
oconn.open application("strconn")
set rsresult=server.createobject("adodb.recordset")
rsresult.cursorlocation=aduseclient '游标的位置
rsresult.cursortype=adopenstatic '游标的类型
rsresult.CacheSize =20
set rsresult.activeconnection=oconn
%>
'jjszb是存储过程的名字
'没有使用command对象
strsql = " jjszb '"& strparameter1 & "','" & strparameter2 & "','" & mode & "','" & bldddm & "','" & dwlxdm & "'"
rsresult.open strsql,oconn,3,adcmdtext
if rsresult.bof and rsresult.eof then
response.write "在数据库中没有找到指定的纪录,请查询"
response.end
end if