ASP does not need to configure IIS to implement pseudo static examples

Source: Internet
Author: User

<!--#include file= "config.asp"-->   
<ol>   
<%    
Set rs=server. CreateObject ("Adodb.recordset")    
sql= "select * from Article"   
Rs.Open Sql,conn, 1,1   
do rs.eof   
%>   
<li><a href= "Article.asp?/<%=rs (" id ")%>.html" ><%=left (Trim (rs ("title"))%></a></li>    
<%   
rs.movenext   
loop   
Rs.close    
Set rs=nothing  
%>   
</ol> 


<%
' Source: Network
Id=request. QueryString ("id")
If id= "" Then
Server_v40=request.servervariables ("Query_string")
Id=int (replace (SERVER_V40, "/", ""), ". html", "")
End If
Call Readnews ()
%>
<div>
Title: <b><%= news_title%></b><br/>
Content: <%=News_content%>
</div>


' URL:. NET tutorial ' >www.111cn.net
' Source: Network
' Database Tutorial Links
db= "Data.mdb"
Set conn = Server.CreateObject ("ADODB. Connection ")
Connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath (DB)
Conn.Open ConnStr
If ERR Then
Err. Clear
Set conn = Nothing
Response.Write "Database connection error, please check the connection string. "
Response.End
End If
' Define the reading of the news reading interface
Dim news_title,news_content
Sub Readnews ()
Set Rs1=server.createobject ("Adodb.recordset")
sql1= "Select Id,title,content from article where id=" & ID
Rs1.open sql1,conn,3,3
News_title=rs1 ("title")
News_content=rs1 ("content")
Rs1.close
Set rs1=nothing
End Sub
%>

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.