llamada de Procedimiento Almacenado por medio de Visual Basic
Hola, pregunta tecnica, se requiere hacer llamado a un procedimiento almacenado ya creado en SQl 7, he invocado por V.Basic 6, Como puedo realizar esta operación ?. Gracias.
Usando el objeto Command de las librerías ADO.
Dim Cmd As New ADODB.Command
Dim R as New ADODB.Recordset
Dim Par as New ADODB.Parameter
Set Cmd.ActiveConection = <variable connection>
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "<nombre store>"
-- Si debieras pasarle parámetros
Set Par = Cmd.CreateParameter("NomParam", tipodato, adParamInput, , valor actual)
Cmd.Parameters.Append Par
Set R = Cmd.Execute
Para poder capturar algo en el recordset, en el procedimiento almacenado, deberás usar las variables de entorno Ret y Txt (miralas en la ayuda de sql server)
Saludos
Dim Cmd As New ADODB.Command
Dim R as New ADODB.Recordset
Dim Par as New ADODB.Parameter
Set Cmd.ActiveConection = <variable connection>
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "<nombre store>"
-- Si debieras pasarle parámetros
Set Par = Cmd.CreateParameter("NomParam", tipodato, adParamInput, , valor actual)
Cmd.Parameters.Append Par
Set R = Cmd.Execute
Para poder capturar algo en el recordset, en el procedimiento almacenado, deberás usar las variables de entorno Ret y Txt (miralas en la ayuda de sql server)
Saludos
