Pages in the article

Source: Internet
Author: User

CopyCode The Code is as follows: <%
Class myarticle
Dim wenzhang_id
Dim title1, content1
Private sub class_initialize ()
'Response. Write "class initialization event: class_initialize <br>"
End sub

Private sub class_terminate ()
'Response. Write "Release object event: 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 class usage instructions
'dim Wenzhang
'set Wenzhang = new myarticle
'wenzhang. id = 3
'call Wenzhang. conn_sub ()
'response. write Wenzhang. title
'response. write Wenzhang. content
'set Wenzhang = nothing
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.