ASP Getting Started instance-reading database program

Source: Internet
Author: User

<!--#include file= "conn.asp"-->
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title></title>
<meta name= "keywords" content= ""/>
<meta name= "description" content= ""/>
<link href= "" rel= "stylesheet" type= "Text/css"/>
<style type= "Text/css" >
<!--
#web {margin-left:auto; margin-right:auto; width:600px; height:auto; text-align:left; margin:0 Auto}
. A {float:left; width:100%; height:auto; border:1px solid #CCC; background: #F8F8F8;}
. A ul {float:left; list-style-type:none;}
. A li {margin-top:8px; margin-bottom:8px;}
. B {float:left; width:100%; height:100px;}
-->
</style>
<body>
<div id= "Web" >
<div class= "A" >
<ul>
<%
I=0
Set Rs=server.createobject ("Adodb.recordset")
sql = "SELECT * from Table order by date Desc"
Rs.Open sql,conn,1,1
If Rs.eof Then
%>
No articles
<%
Else
Do as not rs.eof
%>
<li><a href= "<%=rs (" path ")%>" target= "_blank" ><%=rs ("title")%></a></li>
<%
I=i+1
If I>=8 then Exit Do ' show bar number
Rs.movenext
Loop
End If
Rs.close
%>
</ul>
</div>
<!--advertising-->
<div class= "B" ><br/> advertising position </div>
<div class= "A" >
<ul>
<%
I=0
Set Rs=server.createobject ("Adodb.recordset")
sql = "SELECT * FROM table where auto-Arrange field" (select Top 10 auto-arrange fields from table order by date Desc) Order by date Desc "
Rs.Open sql,conn,1,1
If Rs.eof Then
%>
No articles
<%
Else
Do as not rs.eof
%>
<li><a href= "<%=rs (" path ")%>" target= "_blank" ><%=rs ("title")%></a></li>
<%
I=i+1
If I>=8 then Exit Do ' show bar number
Rs.movenext
Loop
End If
Rs.close
%>
</ul>
</div>
</div>
</body>

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.