国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ajax+asp無限級分類樹型結構(帶數據庫)

2024-05-04 11:00:17
字體:
來源:轉載
供稿:網友
IE測試通過,FF有點小BUG
Cls_Leibie.asp
復制代碼 代碼如下:
<%
'數據庫字段為類屬性,添加、刪除、修改、操作檢查等函數為類的方法
Class Cls_Leibie
Private nClassID,sClassName,nParentID,sParentPath,nDepth,nRootID,nChild,nOrderID,sFilePath '定義私有變量(類的屬性,即數據庫字段對應的變量)
Private rs,sql,ErrorStr
Private Sub Class_Initialize()
ErrorStr="" '初始化錯誤信息為空
End Sub
Private Sub Class_Terminate() '銷毀類時關閉數據庫連接
If IsObject(Conn) Then
Conn.Close
Set Conn = Nothing
End If
End Sub
'*******************設置各個屬性******************************************************
Public Property Let ClassID(str) '獲取類別ID(主鍵)
nClassID=str
call ClassProperty() '獲取類別ID時調用此函數讀出類的所有屬性
End Property
Public Property Let ClassName(str) '獲取類別名稱
sClassName=str
End Property
Public Property Get ClassName
ClassName=sClassName
End Property
Public Property Let ParentID(str) '獲取類別父ID
nParentID=str
End Property
Public Property Get ParentID
ParentID=nParentID
End Property
Public Property Let ParentPath(str) '獲取父路徑ID
sParentPath=str
End Property
Public Property Get ParentPath
ParentPath=sParentPath
End Property
Public Property Let Depth(str) '獲取類別深度
nDepth=str
End Property
Public Property Get Depth
Depth=nDepth
End Property
Public Property Let RootID(str) '獲取類別根ID
nRootID=str
End Property
Public Property Get RootID
RootID=nRootID
End Property
Public Property Let Child(str) '子類別個數
nChild=str
End Property
Public Property Get Child
Child=nChild
End Property
Public Property Let OrderID(str) '排序ID
nOrderID=str
End Property
Public Property Get OrderID
OrderID=nOrderID
End Property
Public Property Let FilePath(str) '類別文件根目錄(生成靜態文件路徑,小站老楊Web技術博客用的是生成靜態,故設置此字段)
sFilePath=str
End Property
Public Property Get FilePath
FilePath=sFilePath
End Property
'******************************************************************************
Private Sub ClassProperty() '讀取類的所有屬性
sql="select * from ArticleClass where ClassID="& nClassID
set rs=conn.execute(sql)
if not rs.eof then
sClassName=trim(rs("ClassName"))
nParentID=trim(rs("ParentID"))
sParentPath=trim(rs("ParentPath"))
nDepth=trim(rs("Depth"))
nRootID=trim(rs("RootID"))
nChild=trim(rs("Child"))
nOrderID=trim(rs("OrderID"))
sFilePath=trim(rs("FilePath"))
end if
set rs=nothing
End Sub
Public Function FAddCheck() '類別添加檢查函數,結果為0表示通過檢查,為1表示有錯誤發生,有錯誤發生時退出函數,將錯誤信息寫入錯誤變量ErrorStr
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 桃园县| 南阳市| 辽阳市| 姚安县| 土默特右旗| 湘阴县| 呼和浩特市| 潮州市| 册亨县| 米易县| 秀山| 临汾市| 南通市| 安远县| 象州县| 衡阳县| 开封县| 调兵山市| 昌平区| 洛南县| 重庆市| 仁化县| 博野县| 大英县| 乌兰浩特市| 兴义市| 苏尼特左旗| 南开区| 莫力| 体育| 三都| 阿图什市| 福清市| 肥西县| 望奎县| 肃南| 平谷区| 马边| 沁水县| 东光县| 台州市|