引用:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>testmb</title></head><body leftmargin="0" topmargin="0"><table width="100%" height="100%" border="0" cellpadding="5" cellspacing="2"> <tr align="right" bgcolor="#CCCCCC"> <td height="20" colspan="2">$cntop$</td> </tr> <tr valign="top"> <td width="25%" bgcolor="#e5e5e5">$cnleft$</td> <td width="74%" bgcolor="#f3f3f3">$cnright$</td> </tr></table></body></html>
引用:<%set conn= Server.CreateObject("ADODB.Connection")connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("testmb.mdb")conn.Open connstr%>
引用:<%dim topcodesub cntop() topcode="现在时间是:" topcode=topcode&now()end subdim leftcode,isub cnleft() for i = 1 to 5 leftcode=leftcode&"<p>cnbruce.com" nextend subdim rightcodesub cnright() for i = 1 to 9 rightcode=rightcode&"<hr color="&i&i&i&i&i&i&">" nextend sub %>[quote]5,最后,调用数据库中的模板代码,将特殊字符串转换。[quote]<!--#include file="conn.asp" --><!--#include file="lib.asp" --><%sql="select * from moban where m_id=1"set rs=Server.CreateObject("adodb.recordset")rs.open sql,conn,1,1mb_code=rs("m_html")rs.closeset rs=nothingcntop()mb_code=replace(mb_code,"$cntop$",topcode)cnleft()mb_code=replace(mb_code,"$cnleft$",leftcode)cnright()mb_code=replace(mb_code,"$cnright$",rightcode)response.write mb_code%>