Description:
Ben
Code Extract data from access to Create HTML files without creating folders.
If the file name is the same as the file name to be created, it will overwrite it. It is the same principle as SQL updates.
To be added: delete and search. Copy code The Code is as follows: <%
'''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''
'
'Subject: ASP creates a static file/html by stabx
'
'Writer: stabx <shawl.qiu@gmail.com>
'
'Blog: http://btbtd.exblog.jp /;
'
'Blog/Site: Phoenix. Gi-P. gi/\ Green School-green Institute
'
'Date: 2006-5-22
'
'''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select top 10 * from (select top 3500 * From ctarticle order by ArticleID ASC) order by ArticleID DESC" 'subquery, which is considered to be more dinosaur than a dinosaur
Rs. Open SQL, mm_conn_string, 1
While not Rs. EOF 'all records of loop creation query are 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 the created File
Cfilename = CID _ & "_" & NCID _ & "_" & Aid _ & ". htm" 'name the file name to be created
set dfso = Createobject ("scripting. fileSystemObject ")
set chtml = dfso. createtextfile (server. mappath (cfilename), true) 'overwrites
chtml. writeline (" ")
chtml. writeline (" ")
chtml. writeline ("" & sitename _ & "" & TT _ & "")
chtml. writeline (" ")
chtml. writeline ("title:" & TT _ & "
")
chtml. writeline ("content:" & CT _ & "
")
chtml. writeline ("created by CID:" & cid _ & "NCID:" & NCID _ & "aid:" & Aid _ & "
")
Aid _ = clng (Aid _)
chtml. writeline ("page created on:" & now ()
chtml. writeline (" ")
chtml. close
Rs. movenext
Wend
Rs. close
set rs = nothing %>