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
