动态吗,是不是想这样?
var
temp: string;
begin
ADOConnection1.Close;
temp:=PromptDataSource(Application.Handle,ADOConnection1.ConnectionString);
ADOConnection1.ConnectionString:=temp;
ADOConnection1.Open;
end;
uses ADOConED;
....
DM.Connection.Close;
if not EditConnectionString(DM.Connection) then
MessageDlg('设置连接参数失败或者被取消!',mtWarning,[mbOk],0);
...
DM.Connection.Open;
if DM.Connection.Connected then
...
else