Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/05/2004, 13:36
Avatar de 8461277
8461277
 
Fecha de Ingreso: diciembre-2002
Ubicación: san juan de los morros
Mensajes: 887
Antigüedad: 22 años, 6 meses
Puntos: 1
Amigo dezuaga modifique un poco tu codigo y de la dos forma me da error:

el codigo completo de la pagina es:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<% If Request.QueryString("refresh") <> "no" then %>
<META HTTP-EQUIV="Refresh" CONTENT="5; URL=Pla_inscrip2.asp?refresh=no">
<% End if %>
<head>
<title>Documento sin t&iacute;tulo</title>
<Script language="javascript">
//Aqui se mana imprimir la hoja automaticamente
function imprimir()
{ if ((navigator.appName == "Netscape")) { window.print() ;
}
else
{ var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser); WebBrowser1.ExecWB(6, -1); WebBrowser1.outerHTML = "";
}
}
</Script>

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<!--El body manda al javascript a imprimir-->
<BODY onload="imprimir();">

<%
'Aqui compruebo que esta colocando 4 digitos
If Len(request.querystring("cedula"))<7 then
'el campo no fue llenado, entonces...
response.write "<CENTER><H1><B>¡ERROR!</B></H1></CENTER>"
response.write "<CENTER><B><H1>Por Favor rellenar con la Cédula Correcta, presiona Volver al Formulario, para intentarlo otra vez</H1></B></CENTER>"
response.end
End If
%>


<%cedula=request.querystring("cedula")
set rs=createobject("ADODB.Recordset")
sqltxt="select * from Alumnos where cedula like '%"&cedula&"%'"
'response.write (sqltxt)
rs.open sqltxt,"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\asp\Portal_Control_Estud io\Alumnos_Postgrado.mdb;"%>

<%if rs.eof then%>
<h3 align="center">
<font color="#FF0000"></h3>
<H1>El Alumno no Existe, por favor presiona <I>"Volver al Formulario"</I> e intenta de nuevo, <I>GRACIAS!!!</I></H1></font></h3>
</CENTER>
<%else%>
<div id="Layer1" style="position:absolute; left:13px; top:15px; width:118px; height:24px; z-index:1; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000;">
<table width="75%" border="0">
<tr>

</tr>
</table>
</div>
<div id="apellido" style="position:absolute; left:61px; top:259px; width:133px; height:22px; z-index:2"><font size="2"><%=rs("Apellidos")%></font>
</div>

<div id="nombre" style="position:absolute; left:229px; top:259px; width:126px; height:21px; z-index:3"><font size="2"><%=rs("Nombre")%></div>
<div id="cedula" style="position:absolute; left:428px; top:259px; width:92px; height:20px; z-index:4"><%=rs("Cedula")%></div>
<div id="sexo" style="position:absolute; left:572px; top:257px; width:72px; height:23px; z-index:5"><%=rs("sexo")%></div>
<div id="direHabi" style="position:absolute; left:58px; top:320px; width:218px; height:21px; z-index:6"><%=rs("dire_habit")%></div>
<div id="ciudad" style="position:absolute; left:390px; top:319px; width:123px; height:20px; z-index:7"><%=rs("ciudad")%></div>
<div id="teleHabit" style="position:absolute; left:549px; top:319px; width:122px; height:18px; z-index:8"><%=rs("tel_habit")%></div>
<div id="postgrado" style="position:absolute; left:64px; top:401px; width:209px; height:23px; z-index:9"><%=rs("postgrado")%></div>
<div id="mencion" style="position:absolute; left:431px; top:396px; width:240px; height:21px; z-index:10"><%=rs("mencion")%></div>
<div id="Layer8" style="position:absolute; left:62px; top:477px; width:230px; height:24px; z-index:11"><%=rs("ano_ingreso")%></div>

<%rs.movenext
rs.close
End if%>

</body>
</html>

La misma imprime la hoja automaticamente y luego vuelve a imprimir la misma hoja pero si los datos, si no la parte donde avisa del error, esto debido a que se refresca otra vez la pagina pierde el numero de cedula y no en cuentra los datos, e probado colocarlo despues del EOF y nada.

Que malo estar pasando????????

Miguel
__________________
Miguel Padrón :cool: