文章內(nèi)頁(yè)類(lèi)
更新時(shí)間:2006年10月18日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<%
class MyArticle
dim wenzhang_id
dim title1,content1
Private Sub Class_Initialize()
'response.Write "類(lèi)的初始化 事件:Class_Initialize<br>"
end sub
Private Sub Class_Terminate()
'response.Write "釋放對(duì)象 事件:Class_Terminate<br>"
end sub
Public Property Let id(byval v)
wenzhang_id = v
End Property
Public Sub conn_sub()
Set conn = Server.createObject("ADODB.Connection")
cnnstr="DRIVER={Microsoft Access Driver (*.mdb)}; "
cnnstr=cnnstr & "DBQ=" & Server.MapPath("admin/WataVase/%29to-dream.mdb")
conn.Open cnnstr
sql = "Select * From Article where Deleted = 0 and ArticleID = "&wenzhang_id
set rs=Server.CreateObject("adodb.recordset")
rs.open sql, conn, 1, 1
title1 = rs("Title")
content1 = rs("Content")
rs.close
set rs = nothing
conn.close
set conn = nothing
end sub
Public Property Get title()
title = title1
End Property
Public Property Get content()
content = content1
End Property
end class
'MyArticle 類(lèi) 使用說(shuō)明
'dim wenzhang
'set wenzhang = new MyArticle
'wenzhang.id = 3
'call wenzhang.conn_sub()
'response.write wenzhang.title
'response.write wenzhang.content
'set wenzhang = nothing
%>
相關(guān)文章
Asp類(lèi) 的數(shù)據(jù)庫(kù)領(lǐng)域
Asp類(lèi) 的數(shù)據(jù)庫(kù)領(lǐng)域...2006-10-10日期函數(shù)擴(kuò)展類(lèi)Ver0.1.1
日期函數(shù)擴(kuò)展類(lèi)Ver0.1.1...2006-10-10asp下生成目錄樹(shù)結(jié)構(gòu)的類(lèi)
本篇文章主要介紹了asp下生成目錄樹(shù)結(jié)構(gòu)的類(lèi),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2007-11-11