[ASP]使用类,实现模块化(6)
If Rs.Eof Then
data="no data"
Else
data=Rs.GetRows()
End if
closers
closeconn()
Call makesession (data)
End Function
''''+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
End Class
试用方法:
Dim action
action=request("k")
If action="view" Then
Call viewnew
ElseIf action="list" Then
Call list()
ElseIf action="read" Then
Call read()
Else
Call ff()
End if
Sub ff()
%>
<form style="border-top:2px solid #008;border-bottom:2px solid #008;margin:auto;background-color:#eee;padding:20px 5px;color:#008;font-weight:bold;">
<label>显示信息总数:<input name="n" type="text" maxlength="4" size="10" />每页数目:<input name="pagesize" type="text" maxlength="4" size="10" value="5"/><input name="arrstart" type="hidden" value="0"></label>
<h5 style="border-top:1px solid #000;padding:5px 0"> 操作:<input name="k" type="submit" value="view" /></h5>
</form> <%End sub%>
<%Sub viewnew()
f_num=killint(request("n"),1,1)
pagesize=killint(request("pageno"),5,5)
arrstart=killint(request("start"),0,0)
rowid=killint(request("rowid"),0,0)
Set cs=new ado_5do8
cs.ConnectString="data/a.mdb"
cs.havese="shi"
cs.rs_top f_num,"site_szd",""
cs.readarraysession arrstart,pagesize,rowid
End sub
Sub list()
response.write("<h5><a href=default.asp>返回默认模式</a></h5>")
response.write"下面显示具体信息:<hr/>"
id=request("id")
id=killint(id,1,1)
Set listid=new ado_5do8
listid.ConnectString="data/a.mdb"
listid.getid=id
listid.gettable="site_szd"
listid.list_ids()
End Sub
Sub read()
response.write"<div style=''''background-color:#ccc;padding:20px 0;color:080;font-weight:bold;border-bottom:2px solid #008''''>页面分析完毕,要更新请选择<a href=default.asp>回到典型模式</a>参数:Start,开始元素;pageno,每页条数</div>"
pagesize=killint(request("pageno"),5,5)
arrstart=killint(request("start"),0,0)
rowid=killint(request("rowid"),0,0)
Set cs=new ado_5do8
cs.havese="shi"
cs.readarraysession arrstart,pagesize,rowid
内容版权声明:除非注明,否则皆为本站原创文章。