ASP Access creates static files/html_ application Tips

Source: Internet
Author: User
Function Description:
This code implements extracting data from Access to create an HTML file, and does not build a folder.
If the file name is the same as the file name you want to create, overwrite the same principle as the SQL update.

To add function: Delete and find.
Copy Code code as follows:

<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' subject:asp Create a static file/html by STABX
'
' Writer:stabx<shawl.qiu@gmail.com>
'
' blog:http://btbtd.exblog.jp/;
'
' Blog/site:phoenix.gi-p.gi/Green College-Institute
'
' Date:2006-5-22
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set rs = Server.CreateObject ("ADODB.") Recordset ")
sql = "SELECT top *" (select top 3500 * out ctarticle ORDER by ArticleID ASC) "" Subquery by ArticleID DESC ", which is currently considered than Dinosaurs and dinosaurs.
Rs. Open SQL, mm_conn_string,1
While not rs.eof ' loops create all records of queries as HTML files
Cid_=rs ("ClassID")
Ncid_=rs ("Nclassid")
Aid_=rs ("ArticleID")
Adt_=rs ("DateAndTime")
Tt_=rs ("title")
Ct_=rs ("content")
' Em_=htmltotext (rs ("email"))
' Ht_=rs ("hits")
' Url_=rs ("url")
' Src_=rs ("www")
' Au_=htmltotext (RS ("writer"))

Response.Write "<a href=" "& Cid_ &" _ "&ncid_&" _ "&aid_&". htm "target=" "_blank" ">" &cid_ & "_" &ncid_& "_" &aid_& ".htm</a> created at" & Now () & "<br>" ' link to create a good file

Cfilename= cid_& "_" &ncid_& "_" &aid_& ". htm" ' Name the file name to create

Set Dfso = CreateObject ("Scripting.FileSystemObject")
Set cHTML = Dfso. CreateTextFile (Server.MapPath (cFileName), true) ' exists that overrides
cHTML. WriteLine ("
cHTML. WriteLine ("<link rel= ' stylesheet ' type= ' text/css ' href= ')." /css/css_first/ctarticle.css ' > ')
cHTML. WriteLine ("<title>" &sitename_& "" &tt_& "</title>")
cHTML. WriteLine ("
cHTML. WriteLine ("title:" & tt_& "<p/>")
cHTML. WriteLine ("Content:" & ct_& "<p/>")
cHTML. WriteLine ("Created by CID:" &cid_& "Ncid:" &ncid_& "aid:" &aid_& "
")
AID_=CLNG (AID_)
cHTML. WriteLine ("Page Created on:" & Now ())
cHTML. WriteLine ("</body>
Chtml.close
Rs.movenext
Wend
Rs.close
Set Rs=nothing%>

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.