Este es el asp donde se ingresan los datos:
Código PHP:
<form name="forma" action="pruebaSP.asp" method="post">
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="73" align="right">
<div align="right"><font color="#999999" ><b>Prueba de Insert en SP </b></font><img src="http://www.forosdelweb.com/images/p1.gif" width="56" height="61" align="absmiddle">
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td height="15" bgcolor="98BEE2" ><div align="center">Número de Operacion:</div></td>
<td height="15" class="formaCampo"> <div align="center">
<input size="50" type="text" maxlength="50" name="op" value="">
</div></td>
</tr>
<tr>
<td height="15" bgcolor="98BEE2" > <div align="center">Número de Cuenta:</div></td>
<td class="formaCampo" height="15"> <div align="center">
<input size="50" type="text" maxlength="50" name="cuenta" value="">
</div></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<div align="right">
<input type="submit" value="Insert SP">
</div>
</form>
Código PHP:
<tr>
<td height="21" colspan="2" align="center">
<!---------------------------------->
<%
op = request.Form("op")
cuenta = request.Form("cuenta")
response.Write("Operacion: "&op&"<br>")
response.Write("Cuenta: "&cuenta&"<br>")
Creo la conexion
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "ejemplo"
sql = "Execute procedure InsertaEjemplo("&op&","&cuenta&")"
response.Write("sql SP: "&sql&"<br><br>")
Set busq = Conn.execute(sql)
if Not busq.eof Then
response.Write("SI PROCEDE")
else
Conn.close
set Conn = Nothing
response.Write("NO PROCEDE")
end if
%>
<!-- AQUI VA EL CONTENIDO -->
</td>
</tr>
Código PHP:
CREATE PROCEDURE InsertaEjemplo
@numOp int,
@numCuenta int
AS
INSERT INTO movimientos(operacion,cvecuenta) VALUES(@numOp, @numCuenta)
RETURN @@IDENTITY
GO
Microsoft OLE DB Provider for SQL Server error '80040e14'
Sintaxis incorrecta cerca de la palabra clave 'procedure'.
en esta la linea que hago la llamada al SP:
Set busq = Conn.execute(sql)
al ejecutar la siguiente linea:
Execute procedure InsertaEjemplo(15,25)
No se que estoy haciendo mal, agradezco su ayuda.