Foros del Web » Programando para Internet » ASP Clásico »

Ayuda, no muestra informacion

Estas en el tema de Ayuda, no muestra informacion en el foro de ASP Clásico en Foros del Web. Me pueden ayudar, estoy empezando con ASP y no encuentro que esta incorrecto, el programa no marca ningun error al ejecutarlo pero no muestra la ...
  #1 (permalink)  
Antiguo 20/06/2003, 08:38
 
Fecha de Ingreso: junio-2003
Ubicación: Nuevo Laredo
Mensajes: 10
Antigüedad: 21 años, 10 meses
Puntos: 0
Ayuda, no muestra informacion

Me pueden ayudar, estoy empezando con ASP y no encuentro que esta incorrecto, el programa no marca ningun error al ejecutarlo pero no muestra la informacion que se esta solicitando.

Agradecere sus valiosos comentarios.

Gracias por adelantado.

Anexo el codigo:

<HTML>
<%

Function LeeCampoTexto(Campo)
If IsNull(Campo) Then
LeeCampoTexto = ""
Else
LeeCampoTexto = Trim(Campo)
End If
End Function


strUsuario=Request.Form("Usuario")
strPAssword=Request.Form("Password")
strFecha1=Request.form("Fecha1")
strFecha2=Request.form("Fecha2")
strTipoOperacion=Request.Form("cmbTipoOperacion")


if not isdate(strFecha1) then
response.write "La Fecha Inicial no es válida"
end if


if not isdate(strFecha2) then
response.write "La Fecha Final no es válida"
end if

%>

<%

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.open ("DSN=CA;UID=ingr;PWD=;")

set rcsUsuarios=oConn.Execute("Select * from UsuariosConsultas where Usuario = '" & strUsuario & "' and Password = '" & strPassword & "'")

if rcsUsuarios.Eof then
response.write "Usuario y/o Password no Registrado" & chr(13) & chr(11)
strcliente=""
strNombreCliente =""
else
strcliente=rcsUsuarios("NumeroCliente")
strNombreCliente=rcsUsuarios("NombreCliente")
end if

if strTipoOperacion="Importación" then
strSQL="Select * from Cuentagastos "
strSQL=strSQL & "where NumeroCliente = '" & strCliente & "' and ImportacionExportacion='I' "
strSQL = strSQL & "and Fecha >= '" & strFecha1 & "' "
strSQL = strSQL & "and Fecha <= '" & strFecha2 & "' "
else
if strTipoOperacion="Exportación" then
strSQL="Select * from Cuentagastos "
strSQL=strSQL & "where NumeroCliente = '" & strCliente & "' and ImportacionExportacion='E' "
strSQL = strSQL & "and Fecha >= '" & strFecha1 & "' "
strSQL = strSQL & "and Fecha <= '" & strFecha2 & "' "
else
strSQL="Select * from Cuentagastos "
strSQL=strSQL & "where NumeroCliente = '" & strCliente & "' "
strSQL = strSQL & "and Fecha >= '" & strFecha1 & "' "
strSQL = strSQL & "and Fecha <= '" & strFecha2 & "' "
end if
end if

strSQL = strSQL & "Order by Fecha"
set rcsCuentagastos=oConn.execute(strSQL)

%>

</head>

<Body>


<table border="0" cellpadding="0" width="800" height="200">
<tr>
<td align="center" width="800%">&nbsp;<img
src="/gif/logot1.gif" alt="Agentes" width="144"
height="123" ></td>
</tr>
<tr>
<td align="center" width="800%"><h3><img
src="/gif/Titulos.gif" width="243" height="26"
alt="r_3.gif (1013 bytes)"></h3>
</td>
</tr>

</Table>
Cliente : <% Response.write strNombreCliente & "<br>" %>
<Table Border=0 Cols = 6>
Del : <% = strFecha1 %> Al : <% = strFecha2 %>
<TR bgcolor= #006666 ALIGN= CENTER>
<TD > <font color= #FFFFFF size= 2 >Cuenta de gastos</font> </TD>
<TD > <font color= #FFFFFF size= 2 >Fecha</font></TD>
<TD > <font color= FFFFFF size= 2 >Trafico</font></TD>
<TD > <Font color = #FFFFFF Size = 2 > No. de Factura</TD>

</TR>

<% set rcsCuentaGastos=oConn.execute("Select * from CuentaGastos where Numerotrafico='" & rcsUsuarios("Numerocliente") & "'") %>

<% do while not rcsCuentaGastos.eof %>

<% if Par=1 then Par=0 else Par=1 %>
<% if Par=1 then Response.write "<TR BGCOLOR=#EAEAEA>" else Response.write "<TR BGCOLOR=#C0C0C0>" %>

<TD><Font Size = 1 ><% Response.Write "<a href=" & Comillas & "/scripts/InformacionTrafico.asp?Numerocuentagastos=" & LeecampoTexto(rcsCuentagastos("Numerocuentagastos" )) & Comillas & ">" & LeecampoTexto(rcsCuentagastos("Numerocuentagastos" )) & "</big>"%> </font> </TD>
<TD><Font Size = 1 ><% Response.Write LeecampoTexto(rcsCuentagastos("Fecha")) %></font></TD>
<TD><Font Size = 1 ><% Response.Write LeecampoTexto(rcsCuentagastos("Numerotrafico")) %></font></TD>
<TD><Font Size = 1 ><% Response.Write LeecampoTexto(rcsCuentagastos("Numerosfacturas")) %></font></TD>

</TR>
<% i=i+1 %>
<% rcsCuentagastos.movenext %>


<% Loop %>
</Table>
<Font Size = 4 >
<HR width="40%" align="left">
Total de Registros : <% = i %>
</Body>
</HTML>
  #2 (permalink)  
Antiguo 20/06/2003, 12:44
Avatar de damargon  
Fecha de Ingreso: junio-2003
Ubicación: Madrid
Mensajes: 386
Antigüedad: 21 años, 10 meses
Puntos: 3
Si no te devuelve nada no es por un error, es por que no encuentra nada qué devolverte, eso sí te aconsejo que nunca metas textos con tilde en valores de variables o cualquier otro elemento de programación.

Haces comparativas con cadenas de texto="Importación" y "Exportación". Prueba a quitar esas tildes. No es una buena costumbre.

Sálúdós, :ó)
  #3 (permalink)  
Antiguo 20/06/2003, 15:52
 
Fecha de Ingreso: junio-2003
Ubicación: Nuevo Laredo
Mensajes: 10
Antigüedad: 21 años, 10 meses
Puntos: 0
Damargon, ya le intente quitandole las tildes y marca error al ejecutarlo el mensaje es caracter invalido.

Pero debe de arrastrar informacion porque en el rango de fechas que estoy solicitando hay movimientos pero no me los muestra, no se si me falte algo en el do while o en el if para que me traiga lo que necesito, no se que puede ser. Tu como ves??

Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:45.