UniConnectDialog CancelButton

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
stanislove
Posts: 2
Joined: Wed 10 May 2017 14:53

UniConnectDialog CancelButton

Post by stanislove » Wed 10 May 2017 15:08

Hi!

Code: Select all

    
  UniConnection1.ConnectDialog:=UniConnectDialog1;
  UniConnection1.LoginPrompt:=true;
  UniConnection1.Connect;

  ShowMessage('Next');
  if UniConnection1.Connected=false then
    ShowMessage('not Connected')
  else
    ShowMessage('Connected');
After clicking the CancelButton in the Connectdialog, the procedure does not work any further (After UniConnection1.Connect).
How can I find out if the CancelButton was pressed

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: UniConnectDialog CancelButton

Post by ViktorV » Wed 10 May 2017 15:19

The similar question has already been discussed on our forum. Follow the link viewtopic.php?t=34655

stanislove
Posts: 2
Joined: Wed 10 May 2017 14:53

Re: UniConnectDialog CancelButton

Post by stanislove » Thu 11 May 2017 06:37

Thanks,
did this

Code: Select all

  if (UniConnectionMain.ConnectDialog<>nil)
    and (UniConnectionMain.LoginPrompt=true) then
    begin
      if not UniConnectionMain.ConnectDialog.Execute then
        Application.Terminate;
    end
  else
    try
      UniConnectionMain.Connect;
    except
    on E: EAbort do Application.Terminate;
    on E: Exception do
      ShowMessage(E.ClassName+'Error: '+E.Message);
    end;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: UniConnectDialog CancelButton

Post by ViktorV » Thu 11 May 2017 07:21

Thank you for being interested in our products.
Feel free to contact us if you have any further questions about our products.

Post Reply