当前位置: 网学 > 编程文档 > ASP > 正文

使用类,实现模块化

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17
or:#020;font-weight:bold;bordr-top:2px solid #008;padding:10px 0;color:#b00''>列表(<a href=default.asp>回到典型模式</a>):"
if Start > 0 then
Response.Write "<A HREF=""?k=read&Start=" & iStart-ipageno &"&pageno=" & ipageno & """>Previous</A>"
end if
if iStop < iRows then
Response.Write " <A HREF=""?k=read&Start=" & iStart+ipageno &"&pageno=" & ipageno & """>Next</A>"
end If

response.write"</div>"

Else
rowid=litter_in(rowid-1,iRows)
response.write("<div style=''width:85%''><h4 style=''text-align:center''><a href=?k=read&pageno="&pageno&"&start="&start&">返回列表</a></h4></h2><hr/><h5>"&server.htmlencode(data(1,rowid))&"</h5><p>"&server.htmlencode(data(2,rowid))&"<h5>+-----"&server.htmlencode(data(3,rowid))&"")
response.write("<div >")
End if
End Function

''-----------------------------------------------------------------
Public Function list_ids()
sql3="select * from "&itable&" where id="&iid&" "
startconn()
Set rs=conn.execute(sql3)
If rs.eof And rs.bof Then
data=Array(0,0,0,0)
Else
data=Rs.GetRows()
End If
closers
closeconn
response.write(UBound(data)&":")
response.write(server.htmlencode(data(2,0)))
End function

''-----------------------------------------------------------------
Public Function rs_top(num,table,whe)
startconn()
sql="select top "&num&" * from "&table&""
sql2="select count(*) as szd_count from "&table&" "" "&whe&""
Set rs=conn.execute(sql2)
szd_count=rs("szd_count")
closers
Set rs = Conn.Execute(sql)
dim data
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

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号