Page 1 of 1

How to handle logon failures using the connection dialog

Posted: Wed 28 Dec 2005 22:51
by Hans
Hi,

I Use TMyConnection and TMyConnectionDialog. i copied the exacmple MyDACConnectForm. I just donot understand how it works. I have set the dialog class and when I start my application the expected custom logon dialog appears. So far so good.

But, why does the dialog appear automatically? AND how do I handle logon errors. When I donot enter a password I get an error message (EDatabase Error) and the retry mechanism does not work. Then the application crashes and I get a windows error (Windows encountered a problem ...)

Does somebody have a working example for this please?

best regards,
hans

Posted: Thu 29 Dec 2005 12:29
by Ikar
> But, why does the dialog appear automatically?

Most possible you have connected to server from design-time. You can avoid this problem by setting MyConnection.Connected to False. Also you can set MyConnection.Options.KeepDesignConnected to False.

> AND how do I handle logon errors.

Use MyConnection.OnError event handler or overwrite TfmMyConnect.DoConnect method.