我的SQLServer2008安装在machine1上,写个小程序能够连接上,把这个程序copy到machine2上执行,发现无法连接,错误:
A network-related or instance-specific error occurred while establishing a conne
ction to SQL Server. The server was not found or was not accessible. Verify that
 the instance name is correct and that SQL Server is configured to allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not open a conne
ction to SQL Server)我已经设置了allow Remote connection, 并且TCP/IP protocol是enable的。我把防火墙都关了。用户名是SQL的authentication: sa请问还需要什么别的设置么?难道非得设定一个域才行吗?

解决方案 »

  1.   

    跟域有何关系?小程序能访问machine1是因为你配置为(local)或者。或者machine1的IP,访问machine2当然要修改配置,程序不知道访问哪个SQL Server。
      

  2.   

    IP     services外围 配置  设置 ip访问
      

  3.   

    回复楼上几位:
    1. machine1 和 machine2 互相可以ping通
    2. 连接串是这样的:server=machine1;database=Testing;User ID=sa;password=abcd1234!;
    3. 如上,我并没有把server设置成local的,我用的是machineName或者IP,都试过了
    4. 请问需要在交换机上做什么手脚?
      

  4.   

    自己的机器肯定是连接串的问题了。如果是express版的instance name要变。
    啊呀,我的连接串在6楼给出来了,谁还有什么办法呢?
      

  5.   

    那是什么?我在微软官网上看,不支持xp系统啊:
    快速描述
    MDAC 2.7 RTM 可重新发布的安装程序会安装与 Microsoft Windows XP 相同的数据访问核心组件。此版本不包括 Microsoft Jet,Microsoft Jet OLE DB Provider,Desktop Database Drivers ODBC Driver 或 Visual FoxPro ODBC Driver。支持的操作系统: Windows 2000; Windows 98; Windows ME; Windows NT