相思资源网 Design By www.200059.com
复制代码 代码如下:
<%
class MyArticle
dim wenzhang_id
dim title1,content1
Private Sub Class_Initialize()
'response.Write "类的初始化 事件:Class_Initialize<br>"
end sub
Private Sub Class_Terminate()
'response.Write "释放对象 事件: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 类 使用说明
'dim wenzhang
'set wenzhang = new MyArticle
'wenzhang.id = 3
'call wenzhang.conn_sub()
'response.write wenzhang.title
'response.write wenzhang.content
'set wenzhang = nothing
%>
<%
class MyArticle
dim wenzhang_id
dim title1,content1
Private Sub Class_Initialize()
'response.Write "类的初始化 事件:Class_Initialize<br>"
end sub
Private Sub Class_Terminate()
'response.Write "释放对象 事件: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 类 使用说明
'dim wenzhang
'set wenzhang = new MyArticle
'wenzhang.id = 3
'call wenzhang.conn_sub()
'response.write wenzhang.title
'response.write wenzhang.content
'set wenzhang = nothing
%>
标签:
文章内页类
相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com
暂无文章内页类的评论...