Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2005, 16:56
Avatar de El_Metallick
El_Metallick
 
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago, Chile
Mensajes: 1.718
Antigüedad: 22 años, 6 meses
Puntos: 16
esto ya me gano

no se porque pero este codigo:
Código:
<%response.expires=-1000%>

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("encuestas.mdb"))


if request.form("opcion")<>"" then


	select case true

	case request.form("opcion")=0
 	  campo="r1"
	case request.form("opcion")=1
		campo="r2"
	case request.form("opcion")=2
   		campo="r3"
	case request.form("opcion")=3
   		campo="r4"
	end select    

	sqltxt="update encuestas set "&campo&" = "&campo&"+1 where activa=True"
	
	conn.execute sqltxt
end if
%>

<html>

<head>

<title>La encuesta</title>
</head>

<body>
<%if request.form("opcion")<>"" then%>
<p align="center">Muchas gracias por participar en la encuesta<br><br>

<%end if
dim colores(3)
colores(0)="black"
colores(1)="black"
colores(2)="black"
colores(3)="black"
tamatabla=400  'tamaño de la tabla



set rs=createobject("ADODB.Recordset")
sqltxt="SELECT  * from encuestas where activa=true"
rs.open sqltxt,conn
if not rs.EOF then
%>

<div align="center">
  <center>
  <table border="1" width="<%=tamatabla%>">
    <tr>
      <td width="<%=tamatabla%>">
        <p align="center"><%=rs("pregunta")%></td>
    </tr>
    <tr>
      <td width="<%=tamatabla%>">
      
        <table border="0" width="<%=tamatabla%>">
         <%totvotos=rs("r1")+rs("r2")+rs("r3")+rs("r4")
         if totvotos< 1 then totvotos=1
         for i = 0 to rs("nopciones")-1 step 1	%>
         <%porcentaje=formatnumber(rs(i+4)*100/totvotos,2)%>
          <tr>
           <td width="<%=tamatabla*30/100%>" valign="top"><b><%=rs(i)%><br><%=porcentaje%>%</td>       
           <td width="<%=tamatabla*70/100%>">
            <table border="0" width="<%=round(porcentaje)%>%" bgcolor="<%=colores(i)%>">
             <tr>  
              <td width="100%"></td>
                </tr>
              </table>
            </td>
          </tr> 
          <%next
            
%>
        </table>
       

      </td>
    </tr>
    <tr>
      <td width="300">
        <p align="center"><font face="Verdana" size="1"><b>Total de  votos: <font color="#FF0000"><%=totvotos%></font> </b></font></p>
      </td>
    </tr>
    <%if rs("inicio")<>"" then%> 

    <tr>
      <td width="300">
        <font face="Verdana" size="1">Fecha de inicio: <%=rs("inicio")%></font>
      </td>
    </tr><%end if%>

    <%if rs("fin")<>"" then%> 
    <tr>
      <td width="300">
        <font face="Verdana" size="1">Fecha de cierre: <%=formatdatetime(rs("fin"),2)%></font>
      </td>
    </tr>
    <%end if%>
  </table>
  </center>
</div>
<%rs.close
set conn = nothing
end if%>
<p align="center"><font face="Verdana" size="1"><a href="javascript:close();">Cerrar ventana</a></font></p>
<p align="center"><font face="Verdana" size="1"><a href="historico.asp">Ver todas las encuestas</a></font></p>
</body>

</html>
me tira este error
Error de Microsoft VBScript en tiempo de ejecución error '800a000d'
No coinciden los tipos: '[string: "¿Cuál es la mejor ba"]'

/Attackmetal/encuestas/verencuesta.asp, line 70
__________________
Haz la guerra en la cama y el amor donde se te de la gana...
El tiempo es el mejor maestro, lo único malo es que te mata...¡¡Aprovecha tu tiempo!!