关于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的问题。

转载于:https://www.cnblogs.com/delphi2007/archive/2008/10/20/1314869.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值