Saludos, tengo dudas si esta bien o mal la llamada a este
proced almacenado y si en el procedimiento las distintas
funciones como sum, Count, avg se usan asi.
Espero me puedan ayudar.
Gracias
-esta es la llamda que envia un parametro-
Public Function ListarAcumXRegId() As ADODB.Recordset
Dim oConn As ADODB.Connection
Dim oCommand As ADODB.Command
Dim oRS As ADODB.Recordset
Set oConn = New ADODB.Connection
oConn.ConnectionString = "File name=" & App.Path
& "\oConn4.udl"
oConn.CursorLocation = adUseClient
oConn.Open
Set oCommand = New ADODB.Command
Set oCommand.ActiveConnection = oConn
oCommand.CommandType = adCmdStoredProc
oCommand.CommandText = "SPCons_ListarAcumXRegId"
oCommand.Parameters(1).Value = Me.RegistracionId
Set oRS = oCommand.Execute
Set ListarAcumXRegId = oRS
Set oRS = Nothing
Set oCommand = Nothing
Set oConn = Nothing
End Function
-y el strore proced-que devuelve un valor
CREATE PROCEDURE SPCons_ListarAcumXRegId
@intRegId_1 [numeric],
@Total [money] output
AS select @Total=Sum(precioCons) from Consumicion
where fecCons <> getdate()
and regId=@intRegId_1
GO
-
'La llamada se podria llegar a hacer asi "CreateParameter"
(no entiendo mucho eta forma, y como retornar valores)
oCommand.parameters cmd.CreateParameter
Leer las respuestas