XP个人版的sql2000,ADOConnection1 用向导连接,“连接”项中,选择本机计算机名,sa方式连接成功。但使用“lolocalhost”或是“127.0.0.1”都不成功。多谢了!!!

解决方案 »

  1.   

    lolocalhost 不行那没得说, 因为是用 (Local)IP不行的话, 你最好贴出你的连接语句
      

  2.   

    我是在 ADOConnection1 的连接向导中 设置的,没用代码。个人版的SQL2000可以调试网络程序吗?
      

  3.   

    可以调的,你试试赋值连接字符 Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
      

  4.   

    Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=czxm;Data Source=127.0.0.1 
      

  5.   

    Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=深度系统   可以Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=127.0.0.1,1433   不行Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=127.0.0.1      也不行Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=localhost    也不行
      

  6.   

    我是想访问网络上的SQL,先在本机上调试,就是不通。(local)是可以的
      

  7.   

    Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=(local)
    Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=.
    Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=127.0.0.1:1433
    试试这三个
      

  8.   

    Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=127.0.0.1:1433
    这个不行,前两个可以
      

  9.   

    你自已在 http://www.connectionstrings.com/sql-server 找吧
      

  10.   

    问题终于自己解决了。是SQL2000的问题,打上了Sp4补丁后就可以连接远程了。Provider=SQLOLEDB.1;Password=123654;Persist Security Info=True;User ID=sa;Initial Catalog=czxm;Data Source=192.168.0.10,1433   大家共同进步!!!
      

  11.   

    没打补丁就不可了吗?
    楼主用过MSDE远程连接数据库吗?