为什么科讯装上了老是数据库错误啊
我想进入admin/login.asp,可它老是就一句话“数据库连接出错,请检查Conn.asp文件中的数据库参数设置。”我都重装了一下系统了,可还是不行,为什么啊同志们...
我想进入admin/login.asp,可它老是就一句话“数据库连接出错,请检查Conn.asp文件中的数据库参数设置。” 我都重装了一下系统了,可还是不行,为什么啊同志们
Call OpenConn
Sub OpenConn()
On Error Resume Next
If DataBaseType = 1 Then
ConnStr="Provider = Sqloledb; User ID = " & datauser & "; Password = " & databasepsw & "; Initial Catalog = " & databasename & "; Data Source = " & dataserver & ";"
SqlNowString = "getdate()"
DataPart_D = "d"
DataPart_Y = "y"
DataPart_H = "hour"
Else
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DBPath)
SqlNowString = "Now()"
DataPart_D = "'d'"
DataPart_Y = "'yyyy'"
DataPart_H = "'h'"
End If
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then Err.Clear:Set conn = Nothing:Response.Write "数据库连接出错,请检查Conn.asp文件中的数据库参数设置。":Response.End
CollcetConnStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(CollectDBPath)
End Sub
Sub CloseConn()
On Error Resume Next
Conn.close:Set Conn=nothing
End sub 展开
Call OpenConn
Sub OpenConn()
On Error Resume Next
If DataBaseType = 1 Then
ConnStr="Provider = Sqloledb; User ID = " & datauser & "; Password = " & databasepsw & "; Initial Catalog = " & databasename & "; Data Source = " & dataserver & ";"
SqlNowString = "getdate()"
DataPart_D = "d"
DataPart_Y = "y"
DataPart_H = "hour"
Else
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DBPath)
SqlNowString = "Now()"
DataPart_D = "'d'"
DataPart_Y = "'yyyy'"
DataPart_H = "'h'"
End If
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then Err.Clear:Set conn = Nothing:Response.Write "数据库连接出错,请检查Conn.asp文件中的数据库参数设置。":Response.End
CollcetConnStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(CollectDBPath)
End Sub
Sub CloseConn()
On Error Resume Next
Conn.close:Set Conn=nothing
End sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询