conndb.asp <% Session.CodePage=65001 response.Charset="utf-8" %> <% '数据库连接文件 dim conn dim connstr connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+server.mappath("../date/#heihuhuhuajian.mdb")+";Jet OLEDB:Database Password=;" set conn=server.createobject("ADODB.CONNECTION") On Error Resume Next conn.open connstr If Err Then err.Clear Set Conn = Nothing Response.Write "数据库连接出错,请检查连接字串。" Response.End End If %> <% '数据库表文件 '全局变量,方便程序的整体转移,这几个变量为核心变量。 dim table,tables,config table="xinwen_fenlei" '定义分类表单的名称 tables="news" '定义存储数据表单的名称 config="class_config" '定义分类属性表单的名称 picwenzi="www.xx.cn" '定义水印图片的文字 pickuandu=400 '定义缩略图的宽度 picgaodu=400 '定义缩略图的高度 pickuandu_xiao=105 '定义缩略图的宽度 picgaodu_xiao=100 '定义缩略图的高度 sites="" %> <% '网站基本信息显示 set rs_jiben=server.CreateObject("adodb.recordset") rs_jiben.open "select * from site where id=1",conn,1,1 wznames=rs_jiben("title") wzmiaoshu=rs_jiben("content") wzkeys=rs_jiben("keys") wztop=rs_jiben("top") wzfoot=rs_jiben("foot") rs_jiben.close set rs_jiben=nothing %>