使用类,实现模块化(5)


Next 
Response.Write "</ul><div style='top:20px;background-color:#ccc;color:#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>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3476.html