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%>