Problemas con condiciones en ASP

01/03/2006 - 11:31 por Manolo | Informe spam
Hola Gente,

Quiero enseñar 3 posibles imagenes en una tabla, por lo cual tengo


<head>

<body>

<%

'Const adOpenKeyset = 1
'Const adLockOptimistic = 3

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


set rs_norma=createobject("ADODB.Recordset")
'rs.CursorType = adOpenKeyset
'rs.LockType = adLockOptimistic

rs_norma.open "select fa_ce from XXXXXXX WHERE fa_id=" &
Request.QueryString("var") & "",conn
if not rs_1.EOF then
do while not rs_1.EOF

%>

<table width="246" height="122" border="0">
<tr>
<th scope="col">

<% if rs_norma("fa_ce")="Cat. III" then%> jpg cat3
<% else %>
<% if rs_norma("fa_ce")="Cat. II" then%> jpg cat2
<% else %>jpg cat1
<%end if %>
<%end if %>

</th>
<th scope="col">&nbsp;</th>
</tr>
</table>

<%rs_norma
loop
end if

rs_norma.close
conn.close
set rs_norma=nothing
set conn=nothing%>

</body>
</html>


y me da error,

Q es lo q estoy haciendo mal ?

Gracias

Preguntas similare

Leer las respuestas

#1 Miguel Gonzalez
01/03/2006 - 14:01 | Informe spam
Hola Manolo.

En el código que posteas...

1) utilizas varios recordsets distintos, pero no estableces y abres el
recordset "rs_1".

2) dentro del "Loop" no le indicas al recordset que avance, por lo que
se repite indefinidamente. Tendrías que hacer algo más o menos así:

<%
Do While Not rs_norma.EOF
%>
Código que se repite a cada vuelta
<%
rs_norma.MoveNext
Loop
%>

Saludos!
Miguel


Manolo escribió:
Hola Gente,

Quiero enseñar 3 posibles imagenes en una tabla, por lo cual tengo


<head>

<body>

<%

'Const adOpenKeyset = 1
'Const adLockOptimistic = 3

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


set rs_norma=createobject("ADODB.Recordset")
'rs.CursorType = adOpenKeyset
'rs.LockType = adLockOptimistic

rs_norma.open "select fa_ce from XXXXXXX WHERE fa_id=" &
Request.QueryString("var") & "",conn
if not rs_1.EOF then
do while not rs_1.EOF

%>

<table width="246" height="122" border="0">
<tr>
<th scope="col">

<% if rs_norma("fa_ce")="Cat. III" then%> jpg cat3
<% else %>
<% if rs_norma("fa_ce")="Cat. II" then%> jpg cat2
<% else %>jpg cat1
<%end if %>
<%end if %>

</th>
<th scope="col">&nbsp;</th>
</tr>
</table>

<%rs_norma
loop
end if

rs_norma.close
conn.close
set rs_norma=nothing
set conn=nothing%>

</body>
</html>


y me da error,

Q es lo q estoy haciendo mal ?

Gracias


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida