文章内页类

所属分类: 网络编程 / ASP编程 阅读数: 335
收藏 0 赞 0 分享
复制代码 代码如下:

<%
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
%>
更多精彩内容其他人还在看

ASP 指南

ASP 指南
收藏 0 赞 0 分享

改进 ASP 的字符串处理性能

改进 ASP 的字符串处理性能
收藏 0 赞 0 分享

pjblog2的参数第1/2页

pjblog2的参数
收藏 0 赞 0 分享

ASP智能搜索的实现

ASP智能搜索的实现
收藏 0 赞 0 分享

网站生成静态页面攻略2:数据采集

网站生成静态页面攻略2:数据采集
收藏 0 赞 0 分享

网站生成静态页面攻略3:防采集策略

网站生成静态页面攻略3:防采集策略
收藏 0 赞 0 分享

网站生成静态页面攻略4:防采集而不防搜索引擎策略

网站生成静态页面攻略4:防采集而不防搜索引擎策略
收藏 0 赞 0 分享

简单分页函数一 常用

简单分页函数一 常用
收藏 0 赞 0 分享

asp最常用的分页函数

asp最常用的分页函数
收藏 0 赞 0 分享

LINE9的目录浏览源程序

LINE9的目录浏览源程序
收藏 0 赞 0 分享
查看更多