ASP Homepage Template article

Source: Internet
Author: User
Template Default.asp
' Here is the sample program shown on the homepage of this site: http://asp.on.net.cn/
' Apply with all of the home page display program.
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title>asp Dynamic Online http://asp.on.net.cn</title>
<link rel= "stylesheet" type= "Text/css" href= "Css/style.css" >
<body bgcolor= "#FFFFFF" >
<div align= "center" >
<p> Homepage Template! Latest 5 News! </p>
<table width= "60%" cellpadding= "0" cellspacing= "0" align= "center" >
<tr>
&LT;TD width= "60%" valign= "Top" height= "Si" >
<table width= "100%" border= "1" cellspacing= "0" cellpadding= "0" align= "center" bordercolorlight= "#000000" bordercolordark= "#FFFFFF" >
<tr>
&LT;TD height= "5" >
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
&LT;TD colspan= "2" height= "8" ><%
Dim conn
Dim connstr

On Error Resume Next
Connstr= "dbq=" +server.mappath ("/new/new.mdb") + ";D efaultdir=;D river={microsoft Access DRIVER (*.mdb)};"
Set Conn=server.createobject ("ADODB. CONNECTION ")
Conn.Open ConnStr
Dim sql
Dim rs
Sql= "SELECT Top 5 * Learning ORDER BY ArticleID Desc"
Set rs= conn.execute (SQL)

If rs.eof and Rs.bof then
Response.Write "<p align= ' center ' > hasn't had any articles </p>"
Else
%><%do While not rs.eof%><font color= "#000099" >0</font> <a href= "<%=rs (" url ")%>" target = "_blank" ><%=rs ("title")%></a>
<i><font color= "#FF0000" > (<%=rs ("DateAndTime")%>) </font></i><br>
<%=rs ("content")%><br>
<%
Rs.movenext
Loop
Rs.close
End If

Set rs=nothing
Conn.close
Set conn=nothing
%> </td>
</tr>
<tr>
&LT;TD colspan= "2" >
<div align= "right" ><a href= "new/index.asp" > Prior announcements >></a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div align= "center" > </div>
</td>
</tr>
</table>


</div>
</body>


Author: o Source: <asp Dynamic Online > http://asp.on.net.cn/

adjourned



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.