Public con As New ADODB.Connection
Public rs As New ADODB.Recordset
-----------------------------------------
Public Sub dbcon()
If con.State = adStateOpen Then con.Close
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=library.mdb;Persist Security Info=False"
con.Open
End Sub
----------------------------------------------
Public Sub rscon()
If rs.State = adStateOpen Then rs.Close
rs.CursorLocation = adUseClient
rs.Open q, con, adOpenDynamic, adLockOptimistic
End Sub
0 Comments