compadre........te agradezco enormemente tu ayuda....pero hice todo lo que dijiste y me aparece "no se encuentra la pagina".....que podra ser ???
este es el codigo con las modificaciones que tu me diste:
Cita: <HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<FORM ACTION='val_buscar.asp' METHOD='GET' id=form1 name=form1>
<script>
function AbrirVentana(ventana)
{
window.open(ventana,"Consulta","left=25,top=25,too lbar=0,location=1,directories=0,status=1,menubar=0 ,scrollbars=1,resizable=0,copyhistory=0,width=750, height=650")}
</script>
</HEAD>
<body bgcolor="#FFCC66" background="2.jpg" text="BLACK" link="BLACK" vlink="BLACK" alink="BLACK">
<p align="center">
<%
if Session("id_usuario") = "" then
Response.Write "<SCRIPT LANGUAGE='JAVASCRIPT'>"
Response.Write "top.opener.close()"
Response.Write "</SCRIPT>"
Response.Redirect("Login.Asp")
end if
dim dbConn
if request.QueryString("extra")="1" then
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "inline; filename=Consulta.xls"
strSQL1=session("SQL_para_EXCEL")
else
'aca recibo los campos que voy a realizar la busqueda
csr = Request.form("csr")
nombre_cliente = Request.form("nombre_cliente")
serie = Request.form("serie")
estado = Request.form("estado")
tecnico = Request.form("tecnico")
On Error Resume next
Const adCmdText = &H0001
Const adOpenStatic = 3
'declaro las variables a utilizar incluyendo la se_encuentra
Dim Rs, Cnn, SQL
set Cnn=Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
Cnn.Open Session("cnx")
'ejecuto la consulta
strSQL="SELECT *, DateDiff (day, fecha_in ,fecha_ret) as difes, DATEDIFF (DAY, fecha_in, getdate()) as difftot FROM tblcliente"
se_encuentra = False
if se_encuentra then
strSQL=strSQL & " AND tipo_cliente LIKE '%cliente'"
else
strSQL=strSQL & " WHERE tipo_cliente LIKE '%cliente'"
se_encuentra=True
end if
if csr <> "" then
if se_encuentra then
strSQL=strSQL & " AND csr LIKE '%"&csr&"'"
else
strSQL=strSQL & " WHERE csr LIKE '%"&csr&"'"
se_encuentra=True
end if
end if
'la variable se_encuentra se inicializa en falso y se cambia a verdadero si el campo trae un valor ingresado
if distribuidor <> "" then
if se_encuentra then
strSQL=strSQL & " AND nombre_cliente LIKE '%"&nombre_cliente&"'"
else
strSQL=strSQL & " WHERE nombre_cliente LIKE '%"&nombre_cliente&"'"
se_encuentra=True
end if
end if
if serie <> "" then
if se_encuentra then
strSQL=strSQL & " AND serie LIKE '%"&serie&"'"
else
strSQL=strSQL & " WHERE serie LIKE '%"&serie&"'"
se_encuentra=True
end if
end if
if estado <> "" then
if se_encuentra then
strSQL=strSQL & " AND estado LIKE '%"&estado&"'"
else
strSQL=strSQL & " WHERE estado LIKE '%"&estado&"'"
se_encuentra=True
end if
end if
if tecnico <> "" then
if se_encuentra then
strSQL=strSQL & " AND tecnico LIKE '%"&tecnico&"'"
else
strSQL=strSQL & " WHERE tecnico LIKE '%"&tecnico&"'"
se_encuentra=True
end if
end if
session("SQL_para_EXCEL")=str1SQL
end if
rs.Open strSQL,Cnn,adopenstatic,adcmdtext
'abrimos la tabla para llamar los registros
if rs.EOF then
Response.Write("No existe el campo ingresado, verifique los datos")
else %>
<br>
<font face="Bookman Old Style"><em>Número de registros seleccionados:</em></font> <b><%=RS.RecordCount%></b>
<p align="center">
<CENTER>
<TABLE WIDTH=1000height="61" BORDER=1 align="center" CELLSPACING="0">
<tr> <td width=74 bordercolor="#F0F0F0" bgcolor="ORANGE"><center><b>Csr</b></center>
<td width=60 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Nombre Cliente</b></center>
<td width=73 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Fecha Ingreso</b></center>
<td width=122 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Artefacto</b></center>
<td width=83 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Serie</b></center>
<td width=95 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Estado</b></center>
<td width=72 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><p><b>Fecha </b><b>Status</b></p></center>
<td width=59 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Tipo de Garantia</b></center>
<td width=76 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Tecnico Asignado</b></center>
<td width=74 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Diferencia Dias Status</b></center>
<td width=74 bordercolor="#FFFFFF" bgcolor="ORANGE"><center><b>Diferencia Dias Total</b></center>
</tr> </table> </CENTER>
<%do while not rs.EOF%>
<center>
<TABLE BORDER=1 CELLSPACING="0" WIDTH=1000>
<tr>
<%Response.Write "<td WIDTH=80 align='center' >"&rs("csr")&"<td WIDTH=100 align='center'>"&rs("nombre_cliente")&"<td WIDTH=99 align='center'>"&rs("fecha_in")&"<td WIDTH=134 align='center'>"&rs("artefacto")&"<td WIDTH=100 align='center' >"&rs("serie")&"<td WIDTH=80 align='center' >"&rs("estado")&"<td WIDTH=102 align='center' >"&rs("fecha_avi")&"<td WIDTH=102 align='center' >"&rs("fecha_ret")&"<td WIDTH=70 align='center' >"&rs("gtia")&"<td WIDTH=100 align='center' >"&rs("tecnico")&"<td WIDTH=100 align='center' >"&rs("difes")&"<td WIDTH=90 align='center' >"&rs("difftot")%>
<br> </tr>
<%rs.Movenext%>
</table></center>
<%loop
end if
rs.Close
set rs = nothing
Cnn.Close
set oCnn = nothing
%>
<h3> <center> <a href="AbrirVentana('val_buscar.asp?extra=1')">EXCE L</a>
</center> </h3>
<br> <br> <font face="Verdana">
<h3> <center> <a href="../buscar_clie.asp">Buscar Otro</a> </center> </h3>
</font>
<br> <br> <font face="Verdana">
<h3> <center> <a href="../menu.asp">Volver al Menu</a> </center> </h3>
</font>
</body>
</html>
por favor !!! ayuda !!!
para que sepas....mi pagina se encuentra en el directorio del localhost con un sitio llamado "bodega" y el val_buscar se encuentra dentro de una carpeta dentro del sitio llamada "scripts"
cuando presiono el boton de excel....me aparece esta ruta en el navegador:
Cita: http://localhost/bodega/Scripts/AbrirVentana('val_buscar_clie.asp?extra=1'
)
sera ese el problema ???
De antemano muchas gracias y te agradezco que siempre que pregunto algo en el foro eres uno de los primeros en responder.......