- 信息来源:武汉做网站 发布时间:2009-5-26 文字大小:[ 大 中 小 ]
- <!--数据库链接文件-->
<%
dim db
set db=server.CreateObject("adodb.connection")
db.open "dbq="& server.MapPath("db.mdb")&";driver={microsoft access driver (*.mdb)}"
%>
<%'调用数据库内的模版
dim sql,rs,sql1,rs1
set rs1=server.CreateObject("adodb.recordset")
sql="select * from db"
rs1.open sql,db,1,1
main=rs1("conten")
set rs1=nothing
'模版调用结束
'diaon
sql="select * from nam"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,db,1,1
pic=rs("nam")
main=replace(main,"$pic$",pic)'对对应内容替换
mm=year(now())&month(now())&day(now())&MONTH(now())&SECOND(now())'产生随机页面号
response.Write mm
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout=fso.createtextfile(server.mappath(""&mm&".htm"))
fout.write main
fout.close
set fout=nothing
set fso=nothing
%>
以下为数据库模版
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>显示名称</title>
</head>
<body>
$pic$
</body>
</html>