文章内页类

发布时间:2022-04-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了文章内页类脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
复制代码 代码如下:

<%
class&nbsp;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 &amp; "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
%>

脚本宝典总结

以上是脚本宝典为你收集整理的文章内页类全部内容,希望文章能够帮你解决文章内页类所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: