ASP advanced article Online Management Update (v)

Source: Internet
Author: User

Author: Beach Boy
The previous article has been introduced to save the articles, and then you should talk about the display of the article. Here, you can see the simple ease of use of ASP, only through a file, you can display all the articles in the database. It opens the records specified in the database and specifies the content that is required for the display, primarily through the article number (ArticleID) returned from the connection and the column information (typeid).
The following is the detailed code and annotations for the article Display page (list.asp):
The Open database connection
<!--#include file= "conn.asp"-->
<%
The Define Variable
Dim sql
Dim rs
Dim typename
Dim typeid
Dim rstype,typesql
"Accept the returned column information and open the specified column recordset type
Typeid=request ("typeID")
Set Rstype=server.createobject ("Adodb.recordset")
Typesql= "SELECT * from type where typeid=" &cstr (typeid)
Rstype.open typesql,conn,1,1
"Invokes the specified column name and assigns its information to the TypeName
Typename=rstype ("type")
"Close the recordset
Rstype.close
%>
Pioneer </title> of <title>asp Dynamic Network
<link rel= "stylesheet" href= "Style.css" >
<body>
<div align= "center" ><center>
<table border= "1" width= "97%" cellspacing= "0" cellpadding= "0" bordercolorlight= "#000000"
bordercolordark= "#FFFFFF" >
<tr>
&LT;TD width= "100%" bgcolor= "#D0D0D0" ><p align= "center" >
"Show Column information
Column:<%=typename&%>
<%
"Opens the specified recordset article and opens the specified article number with the returned article number ID, showing the article number, date of entry, number of views, article title, and article content.
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from Artidle where articleid=" &request ("id")
Rs.Open sql,conn,1,1
%>
----article number: <%=rs ("ArticleID")%>----Date Added: <%=rs ("date")%>----Views: <%=rs ("hits")%></td>

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.