<%
txtpalabra = request("buscador2")
txtfecha = request("buscador3")
If txtfecha <> "NO" then
txtdiainicial = "01"
txtmes = Mid(txtfecha,1,2)
txtano = Mid(txtfecha,3,6)
If txtmes="01" OR txtmes="03" OR txtmes="05" OR txtmes="07" OR txtmes="08" OR txtmes="10" OR txtmes="12" then
txtdiafinal="31"
End If
If txtmes="04" OR txtmes="06" OR txtmes="09" OR txtmes="11" then
txtdiafinal="30"
End If
If txtmes="02" then
if ((txtano mod 4)=0) and ((txtano mod 100)<>0 or (txtano mod 400)=0) then
txtdiafinal="29"
Else
txtdiafinal="28"
End If
End If
txtfechainicial=txtmes & "/01/" & txtano
txtfechafinal=txtmes & "/" & txtdiafinal & "/" & txtano
End If
' response.write "fechainicial=" & txtfechainicial & " fechafinal=" & txtfechafinal & " txtpalabra=" & txtpalabra & " txtfecha=" & txtfecha
%>
<%
sinbusqueda = 0
grupode = 15
regactual = Request.querystring("pos")
If regactual = "" Then
regactual = 1
End If
inicio = regactual
hasta = regactual + grupode -1
Set wConn = Server.CreateObject("ADODB.Connection")
wConn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=D:\XVRT\celem.org\Data\activa\socios.mdb"
Set my3RSet = Server.CreateObject("ADODB.Recordset")
my3RSet.ActiveConnection = wConn
If ((txtpalabra = " Buscar") OR (txtpalabra = "")) AND ((txtfecha = "NO") OR (txtfecha = "")) then
wstr1 = "SELECT * "
wstr1 = wstr1 & "FROM actividades "
wstr1 = wstr1 & "WHERE ((actividades.para_publico)<>'NO' AND (actividades.baja)='NO') "
wstr1 = wstr1 & "ORDER BY actividades.fecha DESC;"
sinbusqueda = 1
Else
If txtpalabra <> " Buscar" then
wstr1 = "SELECT * "
wstr1 = wstr1 & "FROM actividades "
wstr1 = wstr1 & "WHERE actividades.contenido LIKE '%" & txtpalabra & "%' AND ((actividades.baja)='NO' AND (actividades.para_publico)<>'NO')"
wstr1 = wstr1 & " ORDER BY actividades.fecha DESC;"
Else
wstr1 = "SELECT * "
wstr1 = wstr1 & "FROM actividades "
wstr1 = wstr1 & "WHERE ((actividades.fecha) Between #" & txtfechainicial & "# And #" & txtfechafinal & "#) AND ((actividades.baja)='NO' AND (actividades.para_publico)<>'NO')"
wstr1 = wstr1 & " ORDER BY actividades.fecha DESC;"
End IF
End If
'response.write wstr1
%>
<%
my3RSet.Open wstr1, wConn, 3, 3
cuantosreg = my3RSet.RecordCount
If cuantosreg = 0 then
sinbusqueda = 1
End if
If (regactual + grupode) > cuantosreg Then
hasta = cuantosreg
End If
%>
<%
If (cuantosreg - regactual) >= 0 Then
response.write "
Resultados de la Búsqueda: Encontrados " & cuantosreg & " (listado del " & inicio & "al " & hasta & ")
"
Else
Response.Write "
No se encuentran datos
"
end if
%>
<%
'If txtpalabra <> "" Then
If (Not my3RSet.EOF and Not my3RSet.BOF) Then
If regactual = 1 Then
my3RSet.MoveFirst
Else
my3RSet.AbsolutePosition = regactual
End If
Else
fin = 1
End If
Do Until my3RSet.EOF Or contador = grupode
txtiden=my3RSet.Fields("iden").Value
txtfecha=my3RSet.Fields("fecha").Value
txtcontenido=my3RSet.Fields("contenido").Value
txtcomentario=my3RSet.Fields("comentario").Value
txtfichero=my3RSet.Fields("fichero").Value
%>
<%=txtfecha%>
<%=txtcontenido%>
<%=txtcomentario%>
<%
If txtfichero <> "" Then
Response.write "
Ver más ..."
End If
%>
<%
' End IF
my3RSet.MoveNext
contador = contador + 1
Loop
regactuala = regactual - contador
regactuals = regactual + contador
'end if
my3RSet.Close
wConn.Close
set wConn=nothing
%>
<%
'If ((txtpalabra <> "") AND (sinbusqueda = 0)) OR ((txtpalabra = "") AND (sinbusqueda = 1)) Then
If regactual > 0 Then
If (regactual - grupode ) > 0 Then
Response.Write "
<< Anterior"
Else
Response.Write "
<< Anterior"
End If
End If
Response.write "
| "
If (regactual + grupode - 1 - cuantosreg) < 0 Then
Response.Write "
Siguiente >>"
Else
Response.Write "
Siguiente >>"
End If
'else
' Response.Write " "
' Response.Write "
No se encuentran datos
"
'end if
%>