Ver Mensaje Individual
  #9 (permalink)  
Antiguo 12/04/2012, 04:54
Avatar de pempas
pempas
 
Fecha de Ingreso: diciembre-2003
Ubicación: Barcelona
Mensajes: 985
Antigüedad: 22 años, 10 meses
Puntos: 6
Respuesta: URGENTE:capturar datos para actualizar consulta

El código correcto sería así:

Código PHP:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--
#include file="Connections/Conexion1.asp" -->
<%
 
Dim Ad
Dim Ad_numRows
Dim Repeat1__numRows
Dim Repeat1__index
Dim fac 
Dim uni
Dim numPlaz
 
Repeat1__numRows 
= -1
Repeat1__index 
= 0
Ad_numRows 
= Ad_numRows + Repeat1__numRows
 
Set Ad 
= Server.CreateObject("ADODB.Recordset")
Ad.ActiveConnection = MM_Conexion1_STRING
Ad
.Source = "SELECT * FROM Admitidos"
Ad.CursorType = 0
Ad
.CursorLocation = 2
Ad
.LockType = 1
Ad
.Open()
Ad_numRows = 0
%>

<
html>
<
head>
</
head>
<
body>
 
<% While ((
Repeat1__numRows <> 0) AND (NOT Ad.EOF)) %>
 
 <
BR><%fac=(Ad.Fields.Item("FACULTAD").Value)%><B  R />
<
BR><%uni=(Ad.Fields.Item("UNIVERSIDAD").Value)%><  B R />
<
BR><%numPlaz=(Ad.Fields.Item("NUM PLAZAS").Value)%><BR />
 
<%
If (
numPlazas <> "") Then 
set Command1 
= Server.CreateObject("ADODB.Command")
  
Command1.ActiveConnection = MM_Conexion1_STRING
  Command1
.CommandText = "UPDATE [Admitidos] SET NOTA= 30, CANDIDATO=true,  SUPLENTE=true WHERE UNIVERSIDAD= '" + Replace(uni, "'", "''") + "' AND  FACULTAD='" + Replace(fac, "'", "''") + "' ;"
  
  
Command1.CommandType = 1
  Command1
.CommandTimeout = 0
  Command1
.Prepared = true
 Command1
.Execute()
End If
%>
 
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows
=Repeat1__numRows-1
Ad
.MoveNext()%>
<%
WEND%>
 


</
body>
</
html>
<%
Ad.Close()
Set Ad = Nothing
%>