Public Function BuscarCredObs(ByVal credencial As String) As ADODB.Recordset
Dim cm As ADODB.Command
On Error GoTo ErrorBuscarCredObs
Set BuscarCredObs = New ADODB.Recordset
Set cm = New ADODB.Command
With BuscarCredObs
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
End With
With cm
.ActiveConnection = CadenaConecc
.CommandType = adCmdStoredProc
.CommandText = "SH_BuscarCredObs_sel"
.Parameters.Append .CreateParameter("@Credencial", adChar, adParamInput, 8, Mid(Trim(credencial), 1, 8))
.Parameters.Append .CreateParameter("@Fecha", adDate, adParamInput, 8, Date)
.Parameters.Append .CreateParameter("@registros", adInteger, adParamOutput, , lngRegistros)
Set BuscarCredObs = .Execute
End With
ErrorBuscarCredObs:
....
....
End Function