<%@ Language=VBScript %> ENoticias <% dim V_Connection dim V_RNoticias dim sql dim num dim contador Set V_RNoticias = CreateObject("ADODB.Recordset") Set V_Connection = CreateObject("ADODB.Connection") Set V_RParametros = CreateObject("ADODB.Recordset") V_Connection.ConnectionString = "DRIVER=SQL Server;SERVER=196.40.23.206;UID=quimifarma;PASSWORD=farmaquimi;APP=Microsoft Development Environment;WSID=MSSQL2000;DATABASE=Quimifarma" V_Connection.Open sql = "select * from parametros where nombre ='fotos'" V_RParametros.Open sql, V_Connection if Request.Form("Submit1" + ".x") <> "" then Session ("totalreg") = Session ("totalreg") + 4 Session("i") = Session("i") + 4 else if Request.Form("Submit2" + ".x") <> "" then Session ("totalreg") = Session ("totalreg") - 4 session("i") = session("i") - 4 else session("i") = 0 Session ("totalreg") = 4 sql = "select count(*) from noticias where cod_idioma = 0" V_RNoticias.Open sql, V_Connection session("maxreg")= V_RNoticias(0) V_RNoticias.Close end if end if sql = "select * from noticias where cod_noticia > " + cstr(session("i")) + " and cod_noticia <=" + cstr(Session ("totalreg")) + " and cod_idioma = 0" V_RNoticias.Open sql, V_Connection if V_RNoticias.EOF = true then V_RNoticias.Close sql = "select * from noticias where cod_noticia > '0' and cod_noticia <= '4' " + "and cod_idioma = 0" V_RNoticias.Open sql, V_Connection session("i") = 0 Session ("totalreg") = 4 end if %>

.

<% if Request.QueryString <> "" then sql = "select * from noticias where cod_idioma = '0' and cod_noticia = '" + cstr(Request.QueryString) + "'" V_RNoticias.Close V_RNoticias.Open sql, V_Connection %>

<%Response.Write(V_RNoticias(2))%>

<%Response.Write(V_RNoticias(3))%>

" VSPACE=0 HSPACE=0 ALIGN="TOP" BORDER=0> 

<% V_RNoticias.Close else while V_RNoticias.EOF <> true %>

<%Response.Write(V_RNoticias(2))%>

<%Response.Write(Left(V_RNoticias(3),100))%>

width=87 align=top border=0 > 

<% V_RNoticias.MoveNext wend V_RNoticias.Close %>

<% anterior() Response.Write("                                                                                                                      ") siguiente() %>

<% end if %>
<% V_RParametros.Close V_Connection.Close %>