Private cnStateUBookstore As ADODB.Connection
Private Sub Class_Initialize()
' create new connection object
Set cnStateUBookstore = New ADODB.Connection
' open the connection
With cnStateUBookstore
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=sa;Password=;" & _
"Data Source=MSERIES1;" & _
"Initial Catalog=StateUBookstore"
.Open
End With
End Sub
Private Sub Class_Terminate()
' close the connection
cnStateUBookstore.Close
' release the connection variable
Set cnStateUBookstore = Nothing
End Sub