
13/04/2004, 19:42
|
 | | | Fecha de Ingreso: noviembre-2002
Mensajes: 681
Antigüedad: 22 años, 6 meses Puntos: 0 | |
Le hice un cambio, es rechico, si te funciona o no avisame...
<HTML>
<head>
<title>Buscar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000"><center>
<p><b><font size="5">MI BUSCADOR</font></b> </p>
<form name="form1" method="post" action="resultado.asp">
<p>
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Buscar">
</p>
<p align="left"> </p>
</form>
</center>
</body>
</html>
<%
buscar = Request.Form("textfield")
if buscar <> "" then
TamPagina = 40
if Request.Querystring("pagina") = "" then
PaginaActual = 1
else
PaginaActual = CInt(Request.Querystring("pagina"))
end if
set oConn = Server.CreateObject("ADODB.Connection")
set RSBusqueda = Server.CreateObject("ADODB.Recordset")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("equivalencias.mdb") & ";"
sSQL = "SELECT ORIGINAL, MARCA, FAMEL FROM Equivalencias WHERE MARCA LIKE '%"&buscar&"%'"
RSBusqueda.PageSize=TamPagina
RSBusqueda.CacheSize=TamPagina
RSBusqueda.Open sSQL, oConn, 1, 2
PaginasTotales = RSBusqueda.PageCount
Total = RSBusqueda.recordcount
if PaginaActual < 1 then
PaginaActual = 1
end if
if PaginaActual > PaginasTotales then
PaginaActual = PaginasTotales
end if
Tot = 0
'RSBusqueda.AbsolutePage = PaginaActual
If RSBusqueda.BOF And RSBusqueda.EOF Then
Total = RSBusqueda.EOF
'Response.Write Total
'Response.End
%>
<p><font face="Tahoma" size="2">No se ha encontrado nada con <strong><%=Request("palabra")%></strong> en la Base de Datos</font></p>
<%
Else
%>
<table width="100%" align="center" border="0" cellspacing="2" cellpadding="2">
<div align="center"><center>
<table border="1" cellpadding="0" cellspacing="0" width="100%" height="74" bordercolor="#C0C0C0">
<tr>
<td width="26%" height="19"> <p align="center"><strong><font face="Tahoma" size="2">Número
original</font></strong> </td>
<td width="41%" height="19"> <p align="center"><strong><font face="Tahoma" size="2">MARCA</font></strong></p></td>
<td width="33%" height="19"> <p align="center"><strong><font face="Tahoma" size="2">Número
en FAMEL</font></strong> </td>
</tr>
<%
while not RSBusqueda.eof and Tot < TamPagina
%>
<tr>
<td width="26%" bgcolor="#FFCC00" height="20"> <p align="center"><font face="Tahoma" size="2"> <%=(RSBusqueda("original"))%></font></td>
<td width="41%" bgcolor="#FFCC00" height="20"> <p align="center"><font face="Tahoma" size="2"> <%=(RSBusqueda("marca"))%></font></td>
<td width="33%" bgcolor="#FFCC00" height="20"> <p align="center"><font face="Tahoma" size="2"> <%=(RSBusqueda("famel"))%></font></td>
</tr>
<%
Tot = Tot + 1
RSBusqueda.movenext
wend
%>
</table>
<%
end if
%>
<br>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
<%
If PaginaActual > 1 Then
response.Write("<a href=""resultado.asp&pagina=" & PaginaActual - 1 & """>[<< Ant.]</a> ")
End If
For J = 1 To PaginasTotales
If J = PaginaActual Then
response.Write("<font Color=red><B> " & J & " </B></font>")
Else
response.Write("<a href=""resultado.asp?pagina=" & PaginaActual - 1 & """>" & J & "</a> ")
End If
Next
If PaginaActual < PaginasTotales Then
response.Write("<a href=""resultado.asp?pagina=" & PaginaActual - 1 & """>[Sig. >>]</a>")
End If
%>
</td>
</tr>
</table>
<%
else
response.Write("<center>Por favor, especifique su búsqueda.<br><br>")
end if
%>
</body>
</html>
__________________ "Lo importante es nunca dejar de hacerse preguntas"
Albert Einstein |