%
If request.querystring("a") = "" Then
ano2 = DatePart("yyyy",Now())
Else
ano2 = request.querystring("a")
End If
%>
<%
Function ZeroData(dLab)
aa = DatePart("yyyy",t)
aL = Right(aa,2)
ml = DatePart("m",t)
ml = Right(("0" & ml),2)
dl = DatePart("d",t)
dl = Right(("0" & dl),2)
hl = DatePart("h",t)
hl = Right(("0" & hl),2)
nl = DatePart("n",t)
nl = Right(("0" & nl),2)
sl = DatePart("s",t)
sl = Right(("0" & sl),2)
vDat = dL & "/" & mL & "/" & aL
dLab = dL & "/" & mL & "/" & aa
hLab = hL & ":" & nL
End Function
set conn = server.createobject("adodb.connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& _
Server.MapPath ("../Dados/arquetipo.mdb")&";Persist Security Info=False"
SQL = "SELECT * FROM news WHERE NW_shw=1 ORDER BY NW_dat DESC"
SET rs = conn.execute(SQL)
x = 0
While not rs.EOF
t = rs("NW_dat")
Call ZeroData(dLab)
ano1 = DatePart("yyyy",dLab)
If CLng(ano1) = CLng(ano2) Then
x = x +1
%>
" target="iara"><%=dLab%> - <%=rs("NW_man")%>
<%
End If
rs.MoveNext
Wend
rs.close
conn.close
Set rs=Nothing
If x = 0 Then
t = Now()
Call ZeroData(dLab)
%>
<%=dLab%>
Estamos atualizando as notícias
<% End If%>