Another way to show the article System-2

Source: Internet
Author: User
Show 2.dele.asp
<% Wname=trim (Request.QueryString ("name")) ' name for the text file name "wz-n.asp" (n=0,1,2,...) corresponding to the article to be deleted
is also derived from the Wname field in the database
Set Dbconn=server.createobject ("Adodb.connection")
Conpath= "dbq=" &server.mappath ("Wzozg.mdb")
Dbconn. Open "Driver={microsoft Access DRIVER (*.mdb)};" & Conpath
Sql= "Delete from Ozg where wname= '" &wname& "" ' deletes the article information in the database
Dbconn.execute (SQL)
Dbconn.close
Thisfile = Server.MapPath (wname)
Set fs=server.createobject ("Scripting.FileSystemObject")
If Fs. FileExists (Thisfile) Then
Fs. DeleteFile thisfile,true ' Delete the corresponding text file ' wz-n.asp '
End If
Set fs=nothing
%>
3.showwz.asp
<% set Dbconn=server.createobject ("Adodb.connection")
Conpath= "dbq=" &server.mappath (". /.. /db/wzozg.mdb ")
Dbconn. Open "Driver={microsoft Access DRIVER (*.mdb)};" & Conpath
Set Rs=server.createobject ("Adodb.recordset")
Rs.Open sql,dbconn,3,1
Number=rs.recordcount%> ' The general information of all articles into recordset RS
%>
4.wz.asp
<%wname=request.querystring ("Wname") ' the corresponding text file name of the article that comes from showwz.asp to show the content specifically
Set Dbconn=server.createobject ("Adodb.connection")
Conpath= "dbq=" &server.mappath ("Wzozg.mdb")
Dbconn. Open "Driver={microsoft Access DRIVER (*.mdb)};" & Conpath
sql= "Update Ozg set wcount=wcount+1 where wname=" &wname& "
Dbconn. Execute (SQL)
Sql= "Select Wauth,wname,wcontent,wsource,wauth from Ozg where wid=" &id& "
Set Rs=dbconn. Execute (SQL) ' Read the general information of the article you want to display into the recordset
filename = Server.MapPath (wname)
Rs.close
Dbconn. Close
Set fs=createobject ("Scripting.FileSystemObject")
Set thisfile = fs. OpenTextFile (Filename,1,false)
Do as not thisfile. AtEndOfStream
Thisline = Thisfile.readline
If thisline<> "" Then
Thisline=server. HTMLENCODE (Thisline)
Response.Write "<p>" &thisline& "</p>"
End If
Loop
Thisfile.close
Set fs=nothing
%>
---------------------------------------------------
Writen by Aspboy and powered by http://easp.126.com



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.