Objects | collection | data | database <%
’*************************************************************
' Please keep this declaration information when forwarding, this statement does not affect your speed!
’*************************************************************
’*************************************************************
' @author: Noodles
' @realname: Xu Renru
' @email: xurenlu@sohu.com
' @QQ: 55547082
' @Homepage: http://www.ksdn.net
' @ Copyright statement:
' Non-Profit groups or individuals are free to use.
’*************************************************************
’*************************************************************
’*************************************************************
’*************************************************************
Class Rsclass
Private IRs
Private isql
Private iconn
Private Closeconn
Private Openconn
’*************************************************************
' Initialize to create iconn and IRS objects.
’*************************************************************
Private Sub Class_Initialize ()
Set Iconn=server.createobject ("Adodb.connection")
Set Irs=server.createobject ("Adodb.recordset")
End Sub
Public Sub Connect (CONNSTR)
Err.Clear
On Error Resume Next
Iconn.open ConnStr
If Err.number<>0 then Response.Write "Data join is wrong."
End Sub
Public Property Let Conn (connection)
Set Iconn=connection ' incoming a database join via the outside world.
End Property
Private Sub Class_Terminate ()
On Error Resume Next
Irs.close
Iconn.close
Set iconn=nothing
Set irs=nothing
End Sub
’*************************************************************
' Content: Implements statistical functionality, typically using the select COUNT (*) from table where id>54 similar SQL statements.
’*************************************************************
Public function getcountbysql (SQL)
On Error Resume Next
Dim count
Count=iconn.execute (SQL) (0)
Getcountbysql=count
Iconn.close
End Function
’*************************************************************