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

Problemas con paginacion asp + muestra imagen

Estas en el tema de Problemas con paginacion asp + muestra imagen en el foro de ASP Clásico en Foros del Web. Hola, estoy haciendo mis pininos en esto de la creacionde pagnas web, ya he logrado bastante, (creo yo) el hecho es de que al tratar ...
  #1 (permalink)  
Antiguo 21/07/2008, 21:42
 
Fecha de Ingreso: julio-2008
Mensajes: 1
Antigüedad: 15 años, 10 meses
Puntos: 0
Problemas con paginacion asp + muestra imagen

Hola, estoy haciendo mis pininos en esto de la creacionde pagnas web, ya he logrado bastante, (creo yo) el hecho es de que al tratar de paginar resultados para que no me muestre un chorizo de cosas, me sale el siguente error.
Microsoft VBScript compilation (0x800A03ee) Expected ')' /lista_base.asp, linea 42, columna 141 SQL= ("SELECT * FROM PROPIEDADES WHERE PROPIEDAD="& Request.QueryString("P") & " AND ESTATUS=" & Request.QueryString("E") & " ORDER BY CLAVE", ,adCmdText):

Este es el código de mi pagina:

<html>
<head>
<title>ES-INMOBILIARIA Resultados</title>
</head>
<%

Dim CONEXION
Dim RS
Dim RS2
Dim ESTATUS
Dim PROPIEDAD
'sSQL="select lo que tu quieras"
'esta sentencia SQL puede ser creada a partir de un buscador como el que hemos visto en otro reportaje
'y almacenada en una session para emplearla sucesivas veces en el script: session("ssql")=ssql

'actualizamos numero de pagina

If Request.QueryString("pag")<>"" Then
Session("pagina")=Request.QueryString("pag")
Else
Session("pagina")=1
End If
'constantes ADO VBScript
Const adCmdText = &H0001
Const adOpenStatic = 3



'Set Conn = Server.CreateObject("ADODB.Connection")
'Set Command = Server.CreateObject("ADODB.Command")
'Set RS =Server.CreateObject("ADODB.RecordSet")
'Conn.Open "nombre de tu base de datos"
'RS.Open sSQL,Conn,adopenstatic,adcmdtext

'Set CONEXION = Server.CreateObject("ADODB.Connection")
set oConn=Server.CreateObject("ADODB.Connection")

'CONEXION.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\exinmobfoto.mdb"
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/exinmobfoto.mdb")
'CONEXION.Open
' Set RS = CONEXION.Execute ("SELECT * FROM PROPIEDADES WHERE PROPIEDAD=" & Request.QueryString("P") & " AND ESTATUS=" & Request.QueryString("E") & " ORDER BY CLAVE", ,adCmdText)
SQL=("SELECT * FROM PROPIEDADES WHERE PROPIEDAD=" & Request.QueryString("P") & " AND ESTATUS=" & Request.QueryString("E") & " ORDER BY CLAVE", ,adCmdText)
set RS = CONEXION.Execute(SQL)
While Not RS.EOF
Set RS2 = CONEXION.Execute ("SELECT estatus FROM estatus where id =" & RS("estatus"), ,adCmdText)
ESTATUS = RS2("estatus")
Set RS2 = CONEXION.Execute ("SELECT tipo FROM propiedad where id =" & RS("propiedad"), ,adCmdText)
PROPIEDAD = RS2("TIPO")
Response.Write ("page")
Response.Write "<center><IMG SRC="""&RS("NombreFichero")&""">"
Response.Write ("<font= Arial> <strong><br />CLAVE:<BR>" & RS("CLAVE") & "<BR>DESCRIPCION:<BR>" & RS("DESCRIPCION") & "<BR>PRECIO:<BR>" & RS("PRECIO") & "<hr><br><br>")
set RS = CONEXION.Execute(SQL)
'RS.Open SQL, oConn, 3, 1
RS.MoveNext
WEnd

'resultados por pagina a elegir arbitrariamente
num_registros = 3

'Dimensionamos las paginas y determinamos la pagina actual
RS.PageSize=num_registros
RS.AbsolutePage=Session("pagina")
%>

<body>
<div align="center">
Número de página actual: <b><%=Session("pagina")%></b>
<br>
Número de páginas total: <b><%=RS.PageCount%></b>
<br>
Número de registros por página: <b><%=RS.PageSize%></b>
<br>
Número de registros seleccionados: <b><%=RS.RecordCount%></b>
</div>
<br><br>

<table cellspacing="2" cellpadding="2" border="1" align="center">
<%
'Contamos el numero de campos
num_campos=RS.Fields.Count
For campo=0 to num_campos-1%>
<td align="center"><%=RS(campo).Name%></td>
<%
Next
registros_mostrados = 0
While (Not RS.eof And registros_mostrados < num_registros)
registros_mostrados = registros_mostrados +1
%>
<tr>
<%For campo=0 to num_campos-1 %>
<td align="center"><%=RS(campo)%></td>
<%Next%>
</tr>
<%
RS.MoveNext
Wend
%>
<tr>
<td colspan="<%=num_campos%>" align="center">
<%
i=0
While i<RS.PageCount
i=i+1
%>
<b><a href="paginar.asp?pag=<%=i%>"><%=i%></a></b>
<%
Wend
%>
</td>
</tr>
</table>
<%
RS.Close
Conn.Close
%>
</body>
</html>


Espero que me pueda alguien ayudar o que me explique como lograr que este codigo:

<%
Dim CONEXION
Dim RS
Dim RS2
Dim ESTATUS
Dim PROPIEDAD

Set CONEXION = Server.CreateObject("ADODB.Connection")
CONEXION.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\exinmobfoto.mdb"
CONEXION.Open

Set RS = CONEXION.Execute ("SELECT * FROM PROPIEDADES WHERE PROPIEDAD=" & Request.QueryString("P") & " AND ESTATUS=" & Request.QueryString("E") & " ORDER BY CLAVE", ,adCmdText)
While Not RS.EOF
Set RS2 = CONEXION.Execute ("SELECT estatus FROM estatus where id =" & RS("estatus"), ,adCmdText)
ESTATUS = RS2("estatus")
Set RS2 = CONEXION.Execute ("SELECT tipo FROM propiedad where id =" & RS("propiedad"), ,adCmdText)
PROPIEDAD = RS2("TIPO")
Response.Write "<center><IMG SRC="""&RS("NombreFichero")&""">"
Response.Write ("<font= Arial> <strong><br />CLAVE:<BR>" & RS("CLAVE") & "<BR>DESCRIPCION:<BR>" & RS("DESCRIPCION") & "<BR>PRECIO:<BR>" & RS("PRECIO") & "<hr><br><br>")

RS.MoveNext
WEnd

Set CONEXION = Nothing
%>

Lo pueda paginar.
Mil Gracias
Saludos

Última edición por thundermlma; 22/07/2008 a las 17:27 Razón: Equivocaion en el titulo
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 12:04.