Ver Mensaje Individual
  #59 (permalink)  
Antiguo 19/10/2007, 16:04
Avatar de u_goldman
u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 3 meses
Puntos: 98
Re: Actualizar campo Si/No

A ver, reemplaza todo el while que crea los checkboxes con esto:
Código:
	<%		
	Dim strChecks
	strChecks = ""
	do while not RS_buzos.eof  
	%>    
		<table WIDTH="600" ID="Table1">
		<tr>
			<td WIDTH="26">
				<%=i_buzos%>
			</td> 
			<td WIDTH="78">
				<%=RS_buzos("Socio")%>
			</td>                       
			<td WIDTH="395">
				<%=RS_buzos("Nombre")%>
			</td>
			<td WIDTH="77" >
				<input <%if RS_buzos("Patron") = "True" Then Response.Write("CHECKED") End if%> TYPE="checkbox" VALUE="<%=RS_buzos("Id")%>"  NAME="check">
			</td>
		</tr>
		</table>
		<%
		i_buzos = i_buzos + 1
		strChecks = strChecks & RS_buzos("Id") & ","
		RS_buzos.movenext
    loop
    strChecks = left(strChecks, len(strChecks) - 1)
	%>
	<input type="hidden" name="idsSeleccionados" value="<%=strChecks%>" />
y donde recibes reemplaza tu query con esto:
Código:
	<%
	sql = "UPDATE buzos_incl SET Patron = 0 WHERE Id IN ("&Request.Form("idsSeleccionados")&")"
	Conn.Execute(sql)
	sql = "UPDATE buzos_incl SET Patron = 1 WHERE Id IN("&Request.Form("check")&")"
	Conn.Execute(sql)
	%>
A ver si ya funciona...
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway

Última edición por u_goldman; 19/10/2007 a las 16:06 Razón: Edit, los queries estaban mal