简体   繁体   English

DSN无法连接到远程SQL Server

[英]DSN not able to connect to a remote SQL server

I am moving all my existing applications to a new web server, applications use a DSN based connection using ODBC driver. 我将所有现有应用程序移动到新的Web服务器,应用程序使用基于ODBC驱动程序的基于DSN的连接。

On the new server I am trying build DSN which connect's to remote SQL Server, but I am getting the error : 在新服务器上,我正在尝试构建连接到远程SQL Server的DSN,但出现错误:

System.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Invalid connection string attribute

Connection string is : "Dsn=dsnName;uid=userID;pwd=pswd;Provider=SQLOLEDB;Integrated Security=SSPI" 连接字符串为: "Dsn=dsnName;uid=userID;pwd=pswd;Provider=SQLOLEDB;Integrated Security=SSPI"

It works fine on my local PC, but I get this error while establishing DSN on the web server. 它在我的本地PC上运行良好,但是在Web服务器上建立DSN时出现此错误。

If I specify the port number along with the Server name (servername, 6000) then connection went's thru but my application throw the same error. 如果我指定端口号以及服务器名称(服务器名称,6000),那么连接就通过了,但是我的应用程序抛出了同样的错误。

Please help. 请帮忙。

Try using connection string as follows: 尝试如下使用连接字符串:

Server=dsnName;uid=userID;pwd=pswd;Provider=SQLOLEDB;Integrated Security=SSPI" Server = dsnName; uid = userID; pwd = pswd; Provider = SQLOLEDB;集成安全性= SSPI”

or try using 或尝试使用

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI; 数据源= myServerAddress;初始目录= myDataBase;集成安全性= SSPI; User ID=myDomain\\myUsername;Password=myPassword; 用户ID = myDomain \\ myUsername;密码= myPassword;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM