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%"> <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>