在Formcreate里,添加
Adoconnection1.Close;
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Password='''';Persist Security Info=False;User ID=sa;Initial Catalog=example_db;Data Source=wp';
try
adoconnection1.Open();
except
 showmessage('连接数据库失败');
exit;为什么系统提示:用户'administrator'失败呢??

解决方案 »

  1.   

    设计时进行测试连接,将测试连接成功的ConnectionString拷贝出来,在FormCreate事件中赋值就行了。
      

  2.   

    SQLServer换成混合身份验证看看!
      

  3.   

    To maozefa(阿发伯) 
    是啊,我就是直接拷出来的啊。能测试成功。
      

  4.   

    To SmallHand(火龍)还要重新装SQL吗???直接用build去连接是能成功的啊。
      

  5.   

    这是我在formcreat事件里添加的:with adoconnection1 do
    begin
        close;
        connectionstring:='Provider=SQLOLEDB.1;Password='''';Persist Security Info=False;User ID=sa;Initial Catalog=example_db;Data Source=wp';
    end;
    try
        adoconnection1.Open();
    except
        showmessage('数据库连接失败!');然后运行就出现用户'administrator'失败
      

  6.   

    如果是空密码,就把密码的内容去掉
    with adoconnection1 do
    begin
        close;
        connectionstring:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=example_db;Data Source=wp';
    end;
      

  7.   

    SQLServer换成混合身份验证,设置sa连接密码