conn.asp
来自「本代码是一个个人主页」· ASP 代码 · 共 16 行
ASP
16 行
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim db,connstr
Response.Buffer = True
Server.ScriptTimeOut = 90
Session.CodePage=65001
connstr="dbq="&server.mappath("data/fwyblog.mdb")&";driver={Microsoft access driver (*.mdb)}"
set db=server.createobject("adodb.connection")
db.open connstr
If Err Then
Err.Clear
Set Conn = Nothing
Response.Write("<head><meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /><title>数据库连接出错,请检查连接字串</title></head><body><div align=""center"" style=""width:400px;height:100px;padding: 8px;font-size:9pt;border: 1px solid ThreeDShadow;POSITION:absolute;top:expression((document.body.offsetHeight-100)/2);left:expression((document.body.offsetWidth-400)/2);""><table width=""100%"" height=""100%"" style=""font-size:12px;font-family:Tahoma;""><tr><td align=""center""><strong>数据库连接出错,请检查连接字串</strong></td></tr></table></div></body>")
Response.End
End If
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?