<% Session.LCID=1046 Dim rsFotos, localbd, meubd, i, rsVeiculos, rsFotos1, intrec 'Indicando local do Banco de dados localbd="driver={microsoft access driver (*.mdb)};dbq=" & server.mappath("noticias/banco/banco.mdb") 'Setando conexões set meubd=server.createobject("adodb.connection") meubd.Open localbd set rsNoticias=server.createobject("adodb.recordset") set rsOutras=server.createobject("adodb.recordset") currTime = FormatDateTime(date(),vbgeneraldate) if request.querystring("cod")="" then rsNoticias.Open "SELECT * from noticias, noticias_tipo where noticias.tipo=codtipo and expirar>="& currTime & " order by codnoticia desc", meubd ' rsNoticias.Open "SELECT * from noticias, noticias_tipo where destaque=1 and noticias.tipo=codtipo and expirar>="& date() & " order by data desc", meubd else rsNoticias.Open "SELECT * from noticias, noticias_tipo where codnoticia="& request.querystring("cod") &" and codtipo=noticias.tipo", meubd end if rsOutras.Open "SELECT * from noticias where tipo="& rsNoticias("codtipo") &" and codnoticia<> "& rsNoticias("codnoticia") &" and expirar>="& currTime & " order by data desc", meubd 'if (now() < rsNoticias("expirar")) then 'response.Write("ok") 'end if %> Noticias

» Notícias


<% if request.querystring("cod")="" then 'Se houver registros ele mostrará esta parte if NOT rsNoticias.EOF then 'Repetir as notícias encontradas while NOT rsNoticias.EOF AND intrec<5 %> ','Notícias','scrollbars=yes,width=455,height=580')">

<%=rsNoticias("data")%>  -  <%=replace(rsNoticias("chamada"), chr(13), "
")%>


<% rsNoticias.movenext intrec=intrec+1 wend %> <% 'Caso o Recordset esteja vazio, ele mostrará a parte abaixo else %>

Não existem notícias cadastradas

<% end if %> <%else%>
<%=rsNoticias("video")%>
<%if (rsNoticias("link")<>"") then%> ','Notícias')"> " width="100" style="border:none; padding:0 10px 10px 10px;" />
<%end if%>

<%=rsNoticias("data")%>


<%=rsNoticias("titulo")%>

<%=replace(rsNoticias("conteudo"), chr(13), "
")%>

Fonte: <%=rsNoticias("fonte")%>

<% 'MOSTRANDO OUTRAS NOTICIAS RELACIONADAS AO MESMO ASSUNTO 'Só mostrar as outras noticias se não o Recordset não for vazio if NOT rsOutras.EOF then %>

Leia também

<% end if %> <%end if%>