求救,服务器上能运行,本地电脑为什么调试老是出现数据库连接失败
Option ExplicitConst Database = "\database\dfdsggfhhdf.asa"
Dim startime,Conn
Dim NowString
Dim ConnStr
Response.Buffer = True
startime = Timer()
'-----------------------ACCESS数据库连接----------------------------------------
NowString = "Now()"
'ACCESS数据库连接,请使用根路径或者绝对路径
Connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(Database)
Response.Write Connstr
ConnectionDatabase
'-------------------------------------------------------------------------------
Sub ConnectionDatabase()
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
If Err Then
Err.Clear
Set conn = Nothing
Response.Write "<br><br><br><center><font style=color:red;font-size:12pt;><b>数据库连接出错,请检查Inc/Cls_Config.asp文件数据库连接路径!</b></font></center>"
Response.End
End If