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
%>