Description of function:
This code implements the extraction of data from Access to create HTML files without creating folders.
If the file name is the same as the file name to be created, overwrite it, the same principle as SQL update.
Functions to be added: Delete and search.
The code copy is as follows:
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
'subject:Asp Create static file/HTMLByStabx
'
'writer:Stabx<[email protected]>
'
'blog:http://btbtd.exblog.jp/;
'
'blog/site:Phoenix.GI-P.GI//GreenInstitute
'
'date:2006-5-22
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Setrs=Server.CreateObject("ADODB.Recordset")
sql="selecttop10*from(selecttop3500*fromctarticleorderbyarticleidasc)orderbyarticleiddesc"' subquery, currently considered to be more dinosaur than dinosaur
rs.Opensql,MM_conn_string,1
whilenotrs.eof' loop creates all records of the query 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"<ahref=""&cid_&"_"&ncid_&"_"&aid_&".htm""target=""_blank"">"&cid_&"_"&ncid_&"_"&ncid_&"_"&aid_&".htm</a>createdat"&now()&"<br>"'Link creates the file
cfilename=cid_&"_"&ncid_&"_"&aid_&".htm"'Name the file name to be created
setdfso=createobject("scripting.filesystemobject")
Setchtml=dfso.CreateTextFile(server.mappath(cfilename),true)'existence means overwriting
chtml.WriteLine("<html><head>")
chtml.WriteLine("<linkrel='stylesheet'type='text/css'href='../css/css_first/ctarticle.css'>")
chtml.WriteLine("<title>"&sitename_&""&tt_&"</title>")
chtml.WriteLine("</head><body>")
chtml.WriteLine("title:"&tt_&"<p/>")
chtml.WriteLine("content:"&ct_&"<p/>")
chtml.WriteLine("createdbycid:"&cid_&"ncid:"&ncid_&"aid:"&aid_&"
")
aid_=clng(aid_)
chtml.WriteLine("Pagecreatedon:"&now())
chtml.WriteLine("</body></html>")
chtml.close
rs.movenext
wend
rs.close
setrs=nothing%>