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

使用类,实现模块化

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17
conn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(sqlstr)
conn.open strconn
If Err Then
err.Clear
Set Conn = Nothing
mess="发生错误,不能连接数据库"
response.write(mess)
response.End
Else
mess="连接数据库conn成功...........<br/>"
response.write(mess)
End If
End Sub
''----------------------------------------------------------------
private Sub closeconn()
conn.close
Set conn=Nothing
response.write("<strong style=''color:red''>关闭conn连接</strong>...<hr/>")
End sub
''-----------------------------------------------------------------
Private Sub closers()
rs.close
Set rs=Nothing
response.write("<strong style=''color:#085420''>关闭数据库RS</strong>.......<br/>")

End Sub

''-----------------------------------------------------------------
Property Get havese
havese=isession
End Property

Property Let havese(yoursession)
isession=yoursession
If yoursession="" Then
isession="nodef"
End If
End Property

''-----------------------------------------------------------------
Public Function makesession(arraydata)
If IsArray(arraydata) then
makear=arraydata
Else
makear=Array(0,0,0,0)
End If
If isession="" Then
isession="nodef"
End if
session(isession)=makear
End Function
''-----------------------------------------------------------------

private Function getsession()
thisget=session(isession)
If Not IsArray(thisget) Then
thisget=Array(0,0,0,0)
End If
Getsession=thisget
End function
''-----------------------------------------------------------------
Property Get ConnectString
ConnectString = sqlstr
End Property
Property Let ConnectString(str)
sqlstr = str
End Property
''-----------------------------------------------------------------

Property Get getid
getid = iid
End Property
Property Let getid(id)
iid = id
End Property
''-----------------------------------------------------------------

Property Get gettable
gettable = itable
End Property
Property Let gettable(table)
itable = table
End Property
''-----------------------------------------------------------------
''------------------------------------------------------------------
public Function readarraysession(iStart,ipageno,irowid)
rowid=killint(irowid,0,0)
start=killint(istart,0,0)
pageno=killint(ipageno,5,5)
data=getsession
iRows = UBound(data, 2)
iCols = UBound(data, 1)
response.write("<h5>总数获得了:")
response.write("<b> "&iRows+1&"</b>条信息</h5><hr/><ul style=''width:100%;''>")
If rowid = 0 then
If iRows > (ipageno + iStart) Then
iStop = ipageno + iStart - 1
Else
iStop = iRows
End If
For iRowLoop = Start to iStop
Response.Write ("<li style=''padding:4px 0;''><a href=?k=read&rowid="&irowloop+1&">"&data(1, iRowLoop) & " </a><span style=''padding:4px 0 4px 10px;background-color:#ccc; ''>较慢,不推荐点击--><a href=?k=list&id="&data(0,irowloop)&">更新</a></span></li>")
Next
Response.Write "</ul><div style=''top:20px;background-color:#ccc;col

网学推荐

免费论文

原创论文

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