<%
dim oconn,rs,t_sql,connstr
dim t_condicion,t_hay_condicion,t_tablas
dim t_categoria,t_semana,t_titulo,t_palabra
dim t_fecha_inicial , t_fecha_final, t_fecha_inicial_texto
't_fecha_final=cstr(month(date()))+"/"+cstr(day(date()))+"/"+cstr(year(date()))
't_fecha_inicial= dateadd("d",- weekday(date()),date())
't_fecha_inicial_texto= cstr(month(t_fecha_inicial))+"/"+cstr(day(t_fecha_inicial))+"/"+cstr(year(t_fecha_inicial))
't_condicion = " where fecha <= #" + t_fecha_final+"# and fecha > #" +t_fecha_inicial_texto+"#"
t_condicion = " order by fecha desc"
t_hay_condicion=False
t_Tablas = " noticias "
Set oConn = Server.CreateObject("ADODB.connection")
connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.MapPath("noticias.mdb")
oConn.Open ConnStr
'Has to be a serverside cursor.
set RS = server.CREATEOBJECT("ADOR.Recordset")
Rs.cursortype = 3 'adOpenKeyset
Rs.cursorlocation = 2 'adUseServer
'Rs.locktype = 3 'adLockOptimistic
t_sql = "select * from " + t_tablas
t_sql = t_sql + t_condicion
Rs.OPEN t_sql,oConn
dim t_cuantos
t_cuantos = rs.recordcount
t_cuantos = rs.recordcount
if t_cuantos > 0 then
%>
<%dim t_i
for t_i = 1 to 7%>
<% if not rs.EOF then%>
<%rs.MoveNext
end if
next %>
<% end if
rs.close
oconn.close
%>
|
|
Buscador de Noticias
|
|