Http://www.anace.cn/article.asp? /A73.html
The original intention of writing this tutorial has already been clearly stated in the homepage abstract. Now, we can start.
1. The database uses ACCESS. Data. mdb creates a table Article with three fields: ID, Title, and Content; automatic number, Title, and Article Content.
Ii. Config. asp
ASP/Visual Basic Code
- <%
- 'Database Link
- 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. 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
- %>
Iii. Default. asp
ASP/Visual Basic Code
- <! -- # Include file = "config. asp" -->
- <Ol>
- <%
- Set rs = server. CreateObject ("adodb. recordset ")
- SQL = "select * from Article"
- Rs. open SQL, conn, 1, 1
- Do while not rs. eof
- %>
- <Li> <a href = "article. asp? /<% = Rs ("id") %>. html "> <% = left (trim (rs (" title "), 30) %> </a> </li>
- <%
- Rs. movenext
- Loop
- Rs. close
- Set rs = Nothing
- %>
- </Ol>
IV. Article. asp
ASP/Visual Basic Code
- <! -- # Include file = "config. asp" -->
- <%
- 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>
This tutorial has been able to implement the most basic functions. For details, you can see how to apply them!
-------------------------------------------------
I personally think that this search engine optimization has become more complicated. Does a search engine think it has? The link is friendly, so it is a waste of time to draw a snake .. This is also pseudo-friendly. It's just a habit for people.
In addition, I think asp does not consider the pseudo-static aspect. A large search engine is also trying to collect its own data, so they will do their best in dynamic links.