Page 1 of 1

UniConnectDialog CancelButton

Posted: Wed 10 May 2017 15:08
by stanislove
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

Re: UniConnectDialog CancelButton

Posted: Wed 10 May 2017 15:19
by ViktorV
The similar question has already been discussed on our forum. Follow the link viewtopic.php?t=34655

Re: UniConnectDialog CancelButton

Posted: Thu 11 May 2017 06:37
by stanislove
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;

Re: UniConnectDialog CancelButton

Posted: Thu 11 May 2017 07:21
by ViktorV
Thank you for being interested in our products.
Feel free to contact us if you have any further questions about our products.