Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/01/2006, 03:01
Avatar de Jefe_Negro
Jefe_Negro
 
Fecha de Ingreso: diciembre-2005
Mensajes: 50
Antigüedad: 19 años, 4 meses
Puntos: 0
Un ejemplo:

Código:
Public Function CallSPWithRS(objCN As ADODB.Connection, strProcedimiento As String, ParamArray varParametros() As Variant) As ADODB.Recordset

    Dim cmmExec As ADODB.Command
    Dim intX    As Integer
    Dim intTipo As DataTypeEnum
    
    On Error GoTo FuncError
    
    Set cmmExec = New ADODB.Command
    
    cmmExec.ActiveConnection = objCN
    cmmExec.CommandText = strProcedimiento
    cmmExec.CommandType = adCmdStoredProc
    
    For intX = LBound(varParametros) To UBound(varParametros)
        If IsDate(varParametros(intX)) Then
            cmmExec.Parameters.Append cmmExec.CreateParameter(, adDate, adParamInput, , varParametros(intX))
        Else
            cmmExec.Parameters.Append cmmExec.CreateParameter(, adVariant, adParamInput, , varParametros(intX))
        End If
    Next
    
    Set CallSPWithRS= cmmExec.Execute
    
Fin:
    Exit Function

FuncError:
    MsgBox Error
    Resume Fin
    
    
End Function
Esta funcion llama a un procedimiento almacenado cuyo ultimo parametro es un cursor de tipo OUT. En tu caso se llamaria asi

Set Bomba = CallSPWithRS( conexion, "PA_PUMPCONTROLER", 1, 70, 1 )
__________________
Un Saludo
Jefe Negro.


PDF desde ASP ó VB6 Gratis: http://www.oPDF.tk