A VER QUIEN ME AYUDA A DEPURAR ESTE CODIGO EL MISMO LO QUE HACE ES MOSTRAR DE UNA TABLA UNA IMAGEN Y UNA NOTICIA REFERENTE A ESTA IMAGEN, FUNCIONA BIEN PERO FIJENSEN UN TEMA QUE ABRO DOS VECES EL MISMO ARCHIVO COMO PUEDO ARREGLARLO PARA ABRIRLO UNA SOLA VEZ Y QUE FUNCIONE BIEN ?
GRACIAS AL QUE ME AYUDE A OPTIMIZAR ESTE CODIGO
<%
dim oConn, RS
'Creamos los objectos a usar.
Set oConn = Server.CreateObject ("ADODB.Connection")
Set RS = Server.CreateObject ("ADODB.RecordSet")
oConn.Open "Driver={Microsoft Access Driver (*.mdb)}; " & "Dbq=" & Server.MapPath("Noticias.mdb")
'Conectamos a la conexion a la base de datos.
sql = "SELECT * FROM Noticias"
'Abrimos la tabla pidiendo todos sus registros.
RS.Open sql, oConn
'Mostramos el nombre del articulo.
'Ahora el path de la imagen.
Response.Write RS("imagen") & " - "
'Y la siguiente linea muestra la imagen.
Response.Write "<IMG SRC="""&RS("imagen")&""">"
Response.Write "<BR>"
RS.MoveNext
'Cerramos y eliminamos todo.
RS.Close
oConn.Close
Set RS = Nothing
Set oConn = Nothing
%>
</font></div></td>
</tr>
</table>
<table width="771" border="0">
<tr>
<td>
<%
Set con = Server.CreateObject("ADODB.Connection")
Con.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("supermaquinas.mdb"))
sql = "SELECT * FROM supermaquinas WHERE noticias"
'Ejecuta un sentencia SQL de consulta
'Recorre todas las filas del resultado
set result = Con.Execute(sql)
%>
<p align="center">
<%Left cadena, cantidad%>
<br>
<br>
<font face="Arial" size="5" color="#0080C0"><%=result("titulo")%></font><br>
</p>
<table width="823" border="0">
<tr>
<td><font color="#FF0000" size="3" face="Arial"><strong><%=result("copete")%><br>
<br>
</strong></font><font face="Arial" size="3"><%=Left(result("noticia"),1550)%>
<%
noticia = result("noticia")
noticia = Replace(noticia, chr(10), "<br>")
Response.Write(noticia)
%>