asp 网站链接不上 sql 2000数据库怎么办?
sSQLServerName = "127.0.0.1" '服务器名称或IP地址'sSQLServerName = "(local)" '服务器名称或IP地址
sSQLDBUserName = "BD_xdc" '数据库帐号
sSQLDBPassword = "baodin66@i_123" '数据库密码
sSQLDBName = "BD_xudianchi" '数据库名称
<%
'以下程序禁止修改
'==============================================================
'数据库连接
Dim oConn,oRs
err.Clear()
'On Error Resume Next '容错声明
If Not IsObject(oConn) Then
Set oConn = Server.CreateObject("ADODB.Connection")
End If
If Not IsObject(oRs) Then
Set oRs = Server.CreateObject("ADODB.Recordset")
End if
If oConn.State<>1 Then
On Error Resume Next
oConn.Open "Provider=sqloledb;user id="& sSQLDBUserName &";password="& sSQLDBPassword &";initial catalog="& sSQLDBName &";data source="& sSQLServerName &";"
If err.number<>0 then
err.Clear()
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End if
End If
If Err Then
err.Clear
Set oConn = Nothing
Set oRs = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
%>
运行后一直提示错误:数据库连接出错,请检查连接字串。应该怎样解决?