Ver Mensaje Individual
  #13 (permalink)  
Antiguo 08/06/2010, 08:56
Avatar de Wasper
Wasper
 
Fecha de Ingreso: julio-2006
Ubicación: de cai, picha!!!
Mensajes: 1.030
Antigüedad: 17 años, 10 meses
Puntos: 41
Respuesta: Consultar Campo Vacio de una BD

Código ASP:
Ver original
  1. var interruptor
  2. interruptor = 0
  3. for i=1 to 3
  4.     DBresp.open "Select A.Idpregunta, C.Pregunta From (Respuestas A left join Posrespuesta B on (A.Idpregunta = B.Idpregunta)) left join Preguntas C on (A.Idpregunta = C.Idpregunta) Where A.Idpregunta = "& i &" and C.Idpregunta = "& i &"  Group By A.Idpregunta, C.Pregunta", Con
  5.     Do While not DBresp.eof'Inicia el ciclo de preguntas
  6.         response.write "<b>Reactivo " & DBresp("Idpregunta") & ": " & DBresp("Pregunta") & "</b><br />"
  7.         DBresp.movenext
  8.     loop
  9.     DBresp.Close
  10.    
  11.      for j=1 to 3
  12.         Rs.Open "Select A.Idpregunta as AR, C.Idpregunta as AP, B.Idpregunta as APR, B.Posrespuesta From ((Respuestas A left outer join Posrespuesta B on (A.Idpregunta = B.Idpregunta)) left outer join Preguntas C on (A.Idpregunta = C.Idpregunta)) left join Regcontestada D on (A.Idcont = D.Idcont) Where A.respuesta = '"& j &"' and  A.Idpregunta = "& i &" and B.Punpreg = '"& j &"' and C.Idpregunta = "& i &" and D.Carrera = '"& idinst &"' Group By  A.Idpregunta, C.Idpregunta, B.Idpregunta, B.Posrespuesta Order By B.Idpregunta", Con
  13.  
  14.     if Not Rs.EOF Then
  15.         response.Write(Rs("Posrespuesta")) & "</b><br />"
  16.         f=Rs("Posrespuesta")
  17.         Rs.movenext
  18.         Rs.Close
  19.         exit for
  20.             else if Rs.EOF and interruptor = 0 Then
  21.             response.Write("No se contestó") & "</b><br />"
  22.                                 interruptor = 1
  23.         end if
  24.     end if
  25.     Rs.close                       
  26.      Next
  27. interruptor = 0
  28. Next

Asi de pronto se me ocurre que pongas un interruptor (swicht) de esa manera puedes controlar cuantas veces quieres que entre... de todas formas te lo he colocado en sitios que he visto...
__________________
Saludos, Jose

Paginas web y SEO
Anuncios por palabras

Última edición por Wasper; 08/06/2010 a las 09:55