
07/05/2002, 09:34
|
 | | | Fecha de Ingreso: mayo-2001 Ubicación: Gotland-Visvy
Mensajes: 181
Antigüedad: 24 años Puntos: 0 | |
Re: Sistema de noticias! PASO TRES CREA ESTA ASP:
<html>
<head>
<title>Listado de noticias</title>
</head>
<body>
<%
'Abre la conexion con la base de datos a traves de una conexion ODBC
Set con = Server.CreateObject("ADODB.Connection")
Con.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("noticias.mdb")&" ;;"
'Ejecuta un sentencia SQL de consulta
sql = "SELECT * FROM Noticias ORDER BY id DESC"
Set result = con.Execute(sql)
'Recorre todas las filas del resultado
Do While Not result.EOF
' Muestra la fila actual
Response.Write "<p><b><font face=Verdana size=1><a href=noticia.asp?id=" &result.Fields("id") & ">"&result.Fields("titulo&qu ot;)&"</a></b><br><font color=""#696969"">&#149 ; " &result.Fields("copete") & "</font></font></p>"
'Pasa a la siguiente fila
result.MoveNext
Loop
'Libera memoria
result.Close
Set result = Nothing
con.Close
Set con = Nothing
%>
</body>
</html> |