测试conn.asp出错,提示“数据库连接出错,请打开conn.asp文件检查连接字串。”
源码为:<%Dimstartime,Conn,dbResponse.Buffer=Truestartime=Timer()'--定义数据库类别,1为SQL数据库,0为Ac...
源码为:
<%
Dim startime,Conn,db
Response.Buffer = True
startime = Timer()
'--定义数据库类别,1为SQL数据库,0为Access数据库
Const isSqlDataBase = 1
Dim NowString
Dim ConnStr
If IsSqlDataBase = 1 Then
Else
End If
Dim DBPath
'-- 采集数据库连接路径
DBPath = "/database/#collection.mdb" '-- 请用根相对路径
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 "数据库连接出错,请打开conn.asp文件检查连接字串。"
Response.End
End If
End Sub
Sub CloseConn()
On Error Resume Next
If IsObject(Conn) Then
Conn.Close
Set Conn = Nothing
End If
Set Newasp = Nothing
End Sub
%> 展开
<%
Dim startime,Conn,db
Response.Buffer = True
startime = Timer()
'--定义数据库类别,1为SQL数据库,0为Access数据库
Const isSqlDataBase = 1
Dim NowString
Dim ConnStr
If IsSqlDataBase = 1 Then
Else
End If
Dim DBPath
'-- 采集数据库连接路径
DBPath = "/database/#collection.mdb" '-- 请用根相对路径
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 "数据库连接出错,请打开conn.asp文件检查连接字串。"
Response.End
End If
End Sub
Sub CloseConn()
On Error Resume Next
If IsObject(Conn) Then
Conn.Close
Set Conn = Nothing
End If
Set Newasp = Nothing
End Sub
%> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询