我的网站和SQL Server2000数据库安装在同一台服务器中正常工作,现在需要同时使用到另一台服务器的SQL数据库中的数据.
连接语句如下:
<%
On Error Resume Next
Dim ConnStr,Conn
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
SqlDatabaseName = "mmm"
SqlPassword = "130130"
SqlUsername = "sa"
SqlLocalName = "192.168.1.125"
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
%>
我做了如上连接,但连不上,服务器都有密码管理的,原因是什么?
请高手指点。
谢谢!