%
Response.expires = 0
Dim oConn,oCmd,oRs,CadenaConexion
Dim DatosArticulo,numero
Dim IdArticulo,Contador
Dim Totalpaginas,inicial,final,numeromensajes
numeromensajes = 5
numero = Request.QueryString("numero")
pagina = Request.QueryString("pagina")
if pagina = "" then pagina = 0
if numero <> "" then
seleccion = 1
else
seleccion = 2
end if
'Constantes
'----------
CadenaConexion = "Provider=SQLOLEDB;Data Source=" & DB_SERVIDOR & ";Initial Catalog=" & DB_BASEDATOS & ";User Id=" & DB_ADMINISTRADOR_USR & ";Password=" & DB_ADMINISTRADOR_PWD & ";"
'conexion a la base de datos
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open CadenaConexion
'Comando
'-------
Set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
select case seleccion
case 1
oCmd.CommandText = "Consulta_Opinometro_Mensaje"
oCmd.CommandType = 4
'Parametros
'----------
oCmd.Parameters.Append (oCmd.CreateParameter("@numero",3,1,,numero))
'Recordset
'---------
Set oRs = Server.CreateObject("ADODB.Recordset")
Set oRs = oCmd.Execute
If oRs.Eof Then
'Response.redirect "busquedas.asp?msgerror=1"
Else
DatosArticulo = oRs.GetRows
End If
case 2
oCmd.CommandText = "Consulta_Opinometro"
oCmd.CommandType = 4
'Recordset
'---------
Set oRs = Server.CreateObject("ADODB.Recordset")
Set oRs = oCmd.Execute
If oRs.Eof Then
'Response.redirect "busquedas.asp?msgerror=2"
Else
DatosArticulo = oRs.GetRows
End If
end select
'cerrar conexion
Set oRs = Nothing
Set oCmd = Nothing
Set oConn = Nothing
%>
Sonorama :: La Gran Señal Nacional
|
| |
|
 |
 |
|
| |
 |
 |
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| |
|
|
 |
|
| |
<%
totalpaginas = int((Ubound(DatosArticulo,2)+1)/numeromensajes)
a = (Ubound(DatosArticulo,2)+1) mod numeromensajes
if a <> 0 then totalpaginas = int(totalpaginas + 1)
inicio = (Pagina*numeromensajes)
fin = (((Pagina+1)*numeromensajes)-1)
if fin > (Ubound(DatosArticulo,2)) then fin = Ubound(DatosArticulo,2)
%>
<% For Contador = inicio to fin%>
| "<%= Trim(DatosArticulo(6,contador)) %>" |
 |
| <%= DatosArticulo(1,contador) %><%= DatosArticulo(2,contador) %> |
<%= DatosArticulo(3,contador) %> años |
<%= DatosArticulo(4,contador) %> |
<%= DatosArticulo(5,contador) %> |
|
|
|
|
<% Next
dim i
if Totalpaginas>1 then
Response.write "Páginas: "
for i= 0 to Totalpaginas-1
if cint(i) = cint(Pagina) then
Response.Write " " & (i+1)
else
select case seleccion
case 1
cadena = "pagina=" & i
case 2
cadena = "pagina=" & i
end select
%>
<%=i+1%>
<%
end if
next
end if %>
|
|
 |
|
|
|