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

error de time como arreglo esto

Estas en el tema de error de time como arreglo esto en el foro de ASP Clásico en Foros del Web. este es el codigo de mi buscador : <html> <head> <title>Buscar</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <% Dim buscar buscar = Request.Form("textfield") %> <body bgcolor="#FFFFFF" ...
  #1 (permalink)  
Antiguo 25/03/2004, 07:20
 
Fecha de Ingreso: marzo-2004
Mensajes: 6
Antigüedad: 21 años, 1 mes
Puntos: 0
error de time como arreglo esto

este es el codigo de mi buscador :

<html>
<head>
<title>Buscar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
Dim buscar
buscar = Request.Form("textfield")
%>

<body bgcolor="#FFFFFF" text="#000000"><center>
<p><b><font size="5">MI BUSCADOR</font></b> </p>
<%
Function fBuscar(cnn)
SQL="SELECT ORIGINAL, MARCA, muestra FROM Equivalencias WHERE ORIGINAL LIKE '%"&buscar&"%';"
rs.Open SQL
While Not rs.EOF
str = str & rs("ORIGINAL") & rs("MARCA")& rs("muestra")&" <BR> <BR>"
rs.MoveNext
Wend
if str = "" then str ="<CENTER><B>Lo siento, no se encontraron resultados</B></CENTER>"
if buscar = "" then str ="<CENTER><B>Por favor, especifique su búsqueda</B></CENTER>"
fBuscar = str
End Function
Dim cnn, str, rs, SQL
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open "Driver={Microsoft Access Driver (*.mdb)}; " & "Dbq=" & Server.MapPath("tabla4.mdb")


Set rs = CreateObject("ADODB.Recordset")
rs.ActiveConnection = cnn

Response.write "<FONT COLOR=Blue "
Response.write "SIZE=4 FACE=Arial> "
Response.write "Resultados "
Response.write "de la busqueda: <P>"
Response.write "</FONT> "
Response.write "<FONT COLOR=Green "
Response.write "SIZE=3 FACE=Arial> "
Response.Write fBuscar(cnn)
Response.write "</FONT><hr> "
%>
<form name="form1" method="post" action="buscador22.asp">
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Buscar">
</form></center>
</body>
</html>

EL TEMA QUE CUANDO LO SUBO EN EL SERVIDOR ME DA ESTE ERROR


Active Server Pages error 'ASP 0113'

Script timed out

/busquedaequi/buscador22.asp

The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

QUE ESTA MAL DE ESTE CODIGO PARA QUE ME TIRE ESTE ERROR, LA VERDAD NO SE QUE REVISAR SI ALGUIEN ME PUEDE AYUDAR ,
PUEDE SER QUE LA BASE SEA GRANDE , TIENE 80.000 REGISTROS

GRACIAS
  #2 (permalink)  
Antiguo 25/03/2004, 07:32
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años, 11 meses
Puntos: 5
hola... porque no lo paginas mejor??? asi estas forzando la bd con 80,000 registros.. pobre bd....
sabes paginar??
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #3 (permalink)  
Antiguo 25/03/2004, 07:41
 
Fecha de Ingreso: marzo-2004
Mensajes: 6
Antigüedad: 21 años, 1 mes
Puntos: 0
no se paginar recien empiezo con esto me podes ayudar por favor
  #4 (permalink)  
Antiguo 25/03/2004, 08:05
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años, 11 meses
Puntos: 5
hola....
bueno, aqui esta lo que me pediste...

son dos archivos. uno se llama buscar.asp y el otro resultado.asp
chequea:


buscar.asp


<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">
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Buscar">
</form></center>
</body>
</html>




resultado.asp



<html>
<head>
<title>Rsultados de la Búsqueda</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<%
buscar = Request.Form("textfield")

if buscar <> "" then

TamPagina = 10

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("tabla4.mdb") & ";"

sSQL = "SELECT ORIGINAL, MARCA, muestra FROM Equivalencias WHERE ORIGINAL 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=false and RSBusqueda.eof=false then
%>
<table width="100%" align="center" border="0" cellspacing="2" cellpadding="2">
<%
while not RSBusqueda.eof and Tot < TamPagina
%>
<tr>
<td><%=(RSBusqueda("marca"))%></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 & """>[&lt;&lt; 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. &gt;&gt;]</a>")
End If
%>
</td>
</tr>
</table>

<%
else
response.Write("<center>Por favor, especifique su búsqueda.<br><br>")
response.Write("<a href=""javascript:history.back()"">Regresar</a></center>")
end if
%>

</body>
</html>




esta paginado de 10 en 10 registros...
cualquier cosa que no te funcione por favor avisame, no lo he probado pero estoy seguro que esta bien. lo unico que mando a imprimir es el campo marca para que vieras el ejemplo solamente.

bueno, estare aqui conectado por si necesitas algo mas
saludos
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #5 (permalink)  
Antiguo 25/03/2004, 08:22
 
Fecha de Ingreso: marzo-2004
Mensajes: 6
Antigüedad: 21 años, 1 mes
Puntos: 0
Gracias master lo pruebo y despues te aviso
  #6 (permalink)  
Antiguo 25/03/2004, 09:26
Avatar de hipopo  
Fecha de Ingreso: marzo-2004
Ubicación: Lima
Mensajes: 163
Antigüedad: 21 años, 1 mes
Puntos: 0
otra forma, siempre si abusar

Otra forma de ahcer que tus scripts terminen de ejecutarse es aumentando el tiempo de ejecucion de los script en el servidor:

Código:
Server.ScriptTimeout = "Numero de segundos"
Donde numero de se segundos es el que le des, por defecto es 90 segundos. colocalo antes de la busqueda.

Tu dale 180 o 360

pero siempre sin abusar, para mi eso es hacer trampa.. si no queda mas remedio, lo paginas.

Saludos
Hipopo
  #7 (permalink)  
Antiguo 25/03/2004, 09:58
 
Fecha de Ingreso: noviembre-2002
Mensajes: 18
Antigüedad: 22 años, 5 meses
Puntos: 0
Esta muy bueno esto me he copiado el codigo para analizarlo pero una duda sobre esta linea :

><%=(RSBusqueda("marca"))%></td>

como haces para mostrar mas campos aca solo muestras uno y si quiero agregar como seria ?

gracias
  #8 (permalink)  
Antiguo 27/03/2004, 11:34
(Desactivado)
 
Fecha de Ingreso: agosto-2002
Mensajes: 1.458
Antigüedad: 22 años, 8 meses
Puntos: 0
la misma pregunta de quieroaprender como seria la sentencia para mostrar los 3 campos en este caso ?
  #9 (permalink)  
Antiguo 27/03/2004, 14:35
Avatar de bakanzipp  
Fecha de Ingreso: noviembre-2001
Ubicación: santiago de shilli
Mensajes: 2.554
Antigüedad: 23 años, 5 meses
Puntos: 0
<td><%=(RSBusqueda("marca"))%></td>
<td><%=(RSBusqueda("ORIGINAL"))%></td>
<td><%=(RSBusqueda("CAMPO X"))%></td>
...
...
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 01:42.