数据库连接出错,请检查Inc/Cls_Conn.asp文件数据库连接路径 10
OptionExplicitDimstartime,ConnDimServerDatabaseDimNowStringDimConnStrResponse.Buffer=...
Option Explicit
Dim startime,Conn
Dim ServerDatabase
Dim NowString
Dim ConnStr
Response.Buffer = True
startime = Timer()
If IsSqlDataBase = 1 Then
'-----------------------SQL数据库连接参数---------------------------------------
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
NowString = "GetDate()"
SqlDatabaseName = "tee5" '数据库名
SqlUsername = "TeGq" '用户名
SqlPassword = "TeGq" '用户密码
SqlLocalName = "(local)" '连接名(本地用local,外地用IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
'-------------------------------------------------------------------------------
Else
'-----------------------ACCESS数据库连接----------------------------------------
NowString = "Now()"
'ACCESS数据库连接,请使用根路径或者绝对路径
ServerDatabase = "\Database\123.mdb"
Connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(ServerDatabase)
'-------------------------------------------------------------------------------
End If
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_Conn.asp文件数据库连接路径!</b></font></center>"
Response.End
End If
End sub
Sub CloseConn()
On Error Resume Next
If IsObject(Conn) Then
conn.close
set conn=nothing
end if
End Sub
%> 一连接数据库连接出错,请检查Inc/Cls_Conn.asp文件数据库连接路径
看了好几遍都没看出啥来 哪为高手帮帮我 展开
Dim startime,Conn
Dim ServerDatabase
Dim NowString
Dim ConnStr
Response.Buffer = True
startime = Timer()
If IsSqlDataBase = 1 Then
'-----------------------SQL数据库连接参数---------------------------------------
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
NowString = "GetDate()"
SqlDatabaseName = "tee5" '数据库名
SqlUsername = "TeGq" '用户名
SqlPassword = "TeGq" '用户密码
SqlLocalName = "(local)" '连接名(本地用local,外地用IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
'-------------------------------------------------------------------------------
Else
'-----------------------ACCESS数据库连接----------------------------------------
NowString = "Now()"
'ACCESS数据库连接,请使用根路径或者绝对路径
ServerDatabase = "\Database\123.mdb"
Connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(ServerDatabase)
'-------------------------------------------------------------------------------
End If
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_Conn.asp文件数据库连接路径!</b></font></center>"
Response.End
End If
End sub
Sub CloseConn()
On Error Resume Next
If IsObject(Conn) Then
conn.close
set conn=nothing
end if
End Sub
%> 一连接数据库连接出错,请检查Inc/Cls_Conn.asp文件数据库连接路径
看了好几遍都没看出啥来 哪为高手帮帮我 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询