Option Explicit
Dim theCON As ADODB.Connection
Public theRST As ADODB.Recordset
Sub subConn(strFullName As String)
Dim strDrv As String
strDrv = "Data Source=" & strFullName & ";"
theCON.Open "rovider=Microsoft.Jet.OLEDB.4.0;" & strDrv & "Jet OLEDBatabase Password=zxcvbnm,./;"
'其密碼參數如何設定
'theCON.Open "rovider=Microsoft.Jet.OLEDB.4.0;" & strDrv & "Jet OLEDBatabase Password=yourpassword;"
End Sub
Sub subOpen(strCMn As String)
theRST.Open Source:=strCMn, ActiveConnection:=theCON, _
CursorType:=adOpenStatic, LockType:=adLockPessimistic, Options:=adCmdText
End Sub
Private Sub Class_Initialize()
Set theCON = New ADODB.Connection
Set theRST = New ADODB.Recordset
End Sub
Private Sub Class_Terminate()
theCON.Close
Set theRST = Nothing
Set theCON = Nothing
End Sub
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/) |