<% set Conn = Server.CreateObject("ADODB.Connection") Conn.open CDSN query = "SELECT idFoto, evento, data, descricao FROM Fotos ORDER BY data DESC" set RS = Conn.execute (query) %> Perfeita União
<% if RS.EOF then Response.write("

Não há Foto disponível.

") else while (not RS.EOF) %> <% data = PegaDoBD(RS("data")) %>
<% nomeDoArquivo = "foto" & PegaDoBD(RS("idFoto")) MostraFoto nomeDoArquivo, "foto" %>
Evento:

<%= PegaDoBD(RS("evento")) %>

Data:

<%= day(data) & "/" & month(data) & "/" & year(data) %>

Descrição:

<%= PegaDoBD(RS("descricao")) %>

<% RS.MoveNext if not RS.EOF then %>

<% end if wEnd end if %>
<% set RS = nothing Conn.close set Conn = nothing %>