如何在我的Delphi程序中加入一个ADO连接的功能,就像在Delphi中双击ADOConnection控件后弹出的那个连接对话框?
我的E-Mail:[email protected]
谢谢!

解决方案 »

  1.   

    前几天在csdn上看到的,然后我用的!
    主要是:PromptDataSource在adodb单元中
    function TdmGlob.GetConnectionString:String;
    var
        Reg:TRegistry;
    begin
      //获得数据库连接串
        Reg:=TRegIniFile.Create;
        try
            Reg.RootKey:=HKey_Current_User;
            Reg.OpenKey('\SoftWare\海南ATM网络监控',True);
            g_sBackGround:=Reg.ReadString('Background');
            Result:=Reg.ReadString('ConnectString');
            if Result='' then
            begin
                Result:=PromptDataSource(Application.Handle,'');
                if Result<>'' then
                    Reg.WriteString('ConnectString',Result);
            end;
        finally
            Reg.Free;
        end;
    end;
      

  2.   

    引用以下单元:
    uses  AdoConEd
    调用方法:
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      EditConnectionString(ADOConnection1) ;
    end;
      

  3.   

    str := PromptDataSource(Handle, '');