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