关于adoconnection1

关于adoconnection1 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiDB/html/delphi_20061225205158102.html
在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'失败呢??

大家来帮忙啊。

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

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

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

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

这是我在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'失败  
 

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

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

你双击设置不行吗,写多了就容易出错

知道了,是adoquery的问题。

你可能感兴趣的:(Connection)