如何用Button调出ADOQuery的ConectionString设置页

来源:互联网 发布:日内交易精髓 知乎 编辑:程序博客网 时间:2024/06/07 13:42
使用AdoConEd   单元,步骤如下: 
在   uses   语句中包含进   AdoConEd   单元。然后在应用程序需要触发   ADO   连接串编辑器的地方写入如下简单代码。   
procedure TForm1.Button1Click(Sender: TObject);
begin
  ADOConnection1.Close;
  //calling   EditConnectionString   displays   the   dialog,   and
  //sets   the   ConnectString   property   to   the   resulting   value.
  if   EditConnectionString(ADOConnection1)   then
 begin
    //display   the   resulting   ADO   Connect   String,   just   for   fun.
    label11.caption   :=   ADOConnection1.ConnectionString;
 end;
end;
原创粉丝点击