Cita:
Iniciado por u_goldman
Tranquilo, nada mas te esta diciendo que no tienes un objeto
cmd.Parameters.Append cmd.CreateParameter("rec", adSmallInt, adParamInput, 2, rec)
Hola como estan, yo aqui dando lata de nuevo, pues ya lo cheque y si funciona, ya me inserta los datos que capturo en el formulario, ahora solo tengo un problema al momento de solicitar el parametro de salida del SP el cual un @@IDENTITY:
Código PHP:
CREATE PROCEDURE InsertaEjemplo
@rec smallint,
@cuenta float
AS
INSERT INTO movimientos(recaudadora,cvecuenta) VALUES(@rec, @cuenta)
RETURN @@IDENTITY
GO
el codigo asp llamando el SP quedo asi:
Código PHP:
Set cmd = Server.CreateObject("ADODB.Command")
Set Conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "ejemplo"
Set cmd.ActiveConnection = Conn
cmd.CommandText = "InsertaEjemplo"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("rec", adSmallInt, adParamInput, 2, rec)
cmd.Parameters.Append cmd.CreateParameter("cuenta", adDouble, adParamInput, 8, cuenta)
cmd.Parameters.Append cmd.CreateParameter("idReturn", adInteger, adParamOutput,4)
rs = cmd.Execute()
response.Write("ok todo ok")
set rs = nothing
Como debo pedir el valor que me regresa el RETURN @@IDENTITY del SP?