On Error Resume Next dim conn dim connstr dim db db="../Data/info.mdb" Set conn = Server.CreateObject("ADODB.Connection") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db) conn.Open connstr
If conn.Errors.count>0 Then Response.Write "<script language='javascript'>alert('数据库连接出错,请联系系统管理员!');window.location='';</script>" Else 'Response.Write "数据库连接成功!" End If %>