Author: Beach Boy
In the previous section, we introduced the main page of article management, and here the main page just show the relevant connection, if there is no relevant program to execute, then it is only empty connection, and will not show its specific function, and the article online deletion is an indispensable part of the system, although its program is very simple, But it is still necessary for us to introduce.
In ASP, the operation of the database update (update), delete (delete), and other operations, in this system of the deletion of the article is to use the delete to delete the text of the operation, Here is a brief introduction to the main implementation process of this removal program (delete.asp) and detailed annotations:
<%@ language= "VBSCRIPT"%>
<%
"Restrict non-privileged users to delete directly
If Request.Cookies ("Adminok") = "" Then
Response.Redirect "Login.asp"
End If
%>
"Open and establish a database connection
<!--#include file= "conn.asp"-->
<%
Dim sql
Dim rs
Set Rs=server.createobject ("Adodb.recordset")
"Deletes the article for the specified recordset with the article ID returned from the connection
Sql= "Delete from article where articleid=" &request ("ID")
Rs.Open sql,conn,1,1
"Close the database connection
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
Automatically turn to admin page when delete operation is complete
Response.Redirect "Manage.asp"
%>
Look at the above procedure, you are not how to have such a simple idea. In fact, in the ASP, the database operation and display is very simple, and the ASP is because of this simple ease of use and widely circulated in a variety of Web site construction, this is Microsoft's consistent style. OK, below we will enter the article management another content, is the article on-line revision!