Public mycnn As New ADODB.Connection
Public myres As New ADODB.Recordset
Public Function OpenMyres(ByVal txtSql As String)
If myres.State = adStateOpen Then
myres.Close
End If
With myres
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.Open txtSql, mycnn, , adLockPessimistic, adCmdText
End With
End Function