Primero la conexión a la BD:
 
<%@ LANGUAGE = VBScript %>
<%
dim ev
ev=Request.QueryString("evento") 
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject") 
dim cx
Set cx = Server.CreateObject("ADODB.Connection")
cx.Open "ATenis","","" 
'*************************************************  *******************************************
' obtengo todas las fotos
dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * from FotosXEvento WHERE (IdEvento LIKE '" & ev & "')Order by TituloFoto",cx 
'*************************************************  *******************************************
dim fin
fin=0
%>  
y ahora la tabla... 
<table width="81%" border="0" cellspacing="0">
    <tr> 
      <td bgcolor="#000000" colspan="7"><img src="FOTOS/GRAFICA/attivita.gif" width="233" height="39"></td>
    </tr>
    <% if (rs.eof and rs.bof) then %> 
    <tr bgcolor="#FFFFFF"> 
      <td align="center" colspan="15"> </td>
    </tr>
    <% else %> 
	<tr bordercolor="#FFFFFF" bgcolor="#FEECC0">
      <td colspan="7"><font color="#000000" size="2">  <b>    &n  bsp;       &nbs  p;<%=request.QueryString("fecha")%></b></font></td>
    <tr bordercolor="#FFFFFF" bgcolor="#FEECC0"> 
      <td colspan="7"> 
        <blockquote> 
          <p> <font color="#000000" size="3"><b>    <b><%=request.  QueryString("Titulo")%></b> 
            </b></font></p>
        </blockquote>
      </td>
      <%do while not rs.eof
	foto=rs("NombreFoto")
	quefoto = "Fotos/Eventi/" & foto & ".jpg" 
 	quefoto2 = "Fotos/EventiGrande/" & foto & ".jpg" 
%> <!--creas una fila--> 
    <tr bordercolor="#FFFFFF" bgcolor="#FEECC0"> 
      <td width="30"> </td>
      <!-- primera imagen--> 
      <td> 
        <div align="center"><font size="2"> 
		<a href="#" onClick="afoto('<%=quefoto2%>');return false"><img src="<%=quefoto%>" border="1"></a>
		<br>
          <%=rs("TituloFoto")%></font></div>
      </td>
      <!--avanzas un registro y segunda imagen--> <%rs.movenext
if rs.eof then exit do%> <%foto=rs("NombreFoto")
	quefoto = "Fotos/Eventi/" & foto & ".jpg"
quefoto2 = "Fotos/EventiGrande/" & foto & ".jpg" %> 
      <td> 
        <div align="center"><font size="2"> 
		<a href="#" onClick="afoto('<%=quefoto2%>');return false"><img src="<%=quefoto%>" border="1"></a>
		<br>
          <%=rs("TituloFoto")%></font></div>
      </td>
      <!--avanzas un registro y tercera imagen--> <%rs.movenext
if rs.eof then exit do%> <%foto=rs("NombreFoto")
	quefoto = "Fotos/Eventi/" & foto & ".jpg"
quefoto2 = "Fotos/EventiGrande/" & foto & ".jpg" %> 
      <td> 
        <div align="center"><font size="2"> 
		<a href="#" onClick="afoto('<%=quefoto2%>');return false"><img src="<%=quefoto%>" border="1"></a>
		<br>
          <%=rs("TituloFoto")%></font></div>
      </td>
      <!--avanzas un registro y cuarta imagen--> <%rs.movenext
if rs.eof then exit do%> <%foto=rs("NombreFoto")
	quefoto = "Fotos/Eventi/" & foto & ".jpg"
quefoto2 = "Fotos/EventiGrande/" & foto & ".jpg" %> 
      <td> 
        <div align="center"><font size="2"> 
		<a href="#" onClick="afoto('<%=quefoto2%>');return false"><img src="<%=quefoto%>" border="1"></a>
		<br>
          <%=rs("TituloFoto")%></font></div>
      </td>
      <td width="30"><font size="2"></font></td>
      <!-- avanzas un registro, si no hay más sale del bucle--> <%rs.movenext
loop%> <% do while not rs.eof %> 
    <tr bgcolor="#FEECC0"> 
      <td height="24"> </td>
      <td height="24"> </td>
      <td height="24"> </td>
      <td height="24"> </td>
      <td height="24"> </td>
      <td height="24"> </td>
    </tr>
    <tr bgcolor="#FEECC0"> 
      <td height="24" colspan="7"> 
        <p> </p>
        <p> </p>
      </td>
      <%If fin=0 then rs.movenext%> <%If fin=0 then rs.movenext%> </tr>
    <%If not rs.eof Then rs.movenext%> <% loop %> <% end if %> 
    <tr bgcolor="#FFFFFF"> 
      <td colspan="7"> 
        <div align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="807" height="44">
            <param name=movie value="barrainferior.swf">
            <param name=quality value=high>
            <embed src="barrainferior.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="807" height="44">
            </embed> 
          </object></div>
      </td>
    </tr>
  </table> 
Espero aYUDAAAAAAAAAAAAAAAAAAAAAAAA!!!!  
