Public ss As New ADODB.Connection
Public rs As New ADODB.Recordset
ss.ConnectionString = "Provider=SQLOLEDB.1;Data Source=dbname;Persist Security Info=False"
ss.Open
With rs
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open SQL, ss
End With