×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

请教一个奇怪的SQL SERVER连接问题 - "SQL Server does not exist or access denied":

我用ASP.NET连接SQL SERVER 2000 (同DOMAIN, 远程), 代码很简单:
SqlConnection conn = new SqlConnection("server=myserver;database=myDB;UID=myUID;PWD=myPWD);
conn.Open();
在我的开发机上运行时出错: "SQL Server does not exist or access denied". 奇怪的是我用其它各种方法都能连上这个SERVER:

PING 能连上;
用我开发机上的SQL SERVER CLIENT能连上;
ODBC测试能连上;
用VS.NET的SERVER EXPLORER能连上, 拖放生成的SqlConnection控件测试也能连上- 但运行conn.Open();也出错;
同样的代码换个SQL SERVER 也能连上;
我同事机器也能连上;
试着把APPLICATION放到PRODUCTION SERVER上, 也能连上并正常工作;

就是在我的开发机上运行出错, 同样的代码放到别的WEB APPLICATION上也出错 - 肯定不是拚写错误!

谢谢!
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / 请教一个奇怪的SQL SERVER连接问题 - "SQL Server does not exist or access denied":
    我用ASP.NET连接SQL SERVER 2000 (同DOMAIN, 远程), 代码很简单:
    SqlConnection conn = new SqlConnection("server=myserver;database=myDB;UID=myUID;PWD=myPWD);
    conn.Open();
    在我的开发机上运行时出错: "SQL Server does not exist or access denied". 奇怪的是我用其它各种方法都能连上这个SERVER:

    PING 能连上;
    用我开发机上的SQL SERVER CLIENT能连上;
    ODBC测试能连上;
    用VS.NET的SERVER EXPLORER能连上, 拖放生成的SqlConnection控件测试也能连上- 但运行conn.Open();也出错;
    同样的代码换个SQL SERVER 也能连上;
    我同事机器也能连上;
    试着把APPLICATION放到PRODUCTION SERVER上, 也能连上并正常工作;

    就是在我的开发机上运行出错, 同样的代码放到别的WEB APPLICATION上也出错 - 肯定不是拚写错误!

    谢谢!
    • check what kind of authentication SQL is using. some useful info: http://support.microsoft.com/kb/328306
      • Thanks. Authentication should not be the problem. I'll double-check it next Monday though.
    • DISABLENETWORKPROTOCOLS
      • Thanks. Could you please provide some details?
        • DISABLENETWORKPROTOCOLS=0
          1. uninstalled whatever you have installed.
          2. setup DISABLENETWORKPROTOCOLS=0 SAPWD="...."

          Note,
          a. replace the "..." with your password
          b. strongly recommend google "MSDE+DISABLENETWORKPROTOCOLS" first

          Note for the note, according to the "Oxford English Dictionary (OED)", google is a verb, people normally google things on Google (www.google.com).
          • Apparently it does not apply to my case. Thanks anyway.