Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Login form connected to database
Thu, May 21 2015 11:54 AMPermanent Link

Mike

Hi,

I have a login form (Delphi) which checks the username in EDB (local database).

If username and password are valid the application continues (which is good).

However when the credentials are invalid a remote login popup does appear. How can this be prevented?

Regards,

Mike

Thu, May 21 2015 11:58 AMPermanent Link

Matthew Jones

Mike wrote:

> However when the credentials are invalid a remote login popup does
> appear. How can this be prevented?

This appears to be the answer:

http://www.elevatesoft.com/manual?action=viewtype&id=edb2&product=rsdelphiwin32&version=XE2&type=TEDBSessionLoginEvent

background at:

http://www.elevatesoft.com/manual?action=viewtopic&id=edb2&product=rsdelphiwin32&version=XE2&topic=Connecting_Sessions


Essentially, you tell it not to continue, and try again.

--

Matthew Jones
Thu, May 21 2015 12:24 PMPermanent Link

Mike

I have already set Continue to false in this event but then an exception is shown.

Exception is #501 Login failed.

How can this be prevented?
Thu, May 21 2015 12:43 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/21/2015 12:24 PM, Mike wrote:
> I have already set Continue to false in this event but then an exception is shown.
> Exception is #501 Login failed.
> How can this be prevented?

Just intercept the error so it does not get shown and deal with the
login failure any way you want.

Raul

Thu, May 21 2015 1:32 PMPermanent Link

Mike

Thanks!

It is working but still have questions if there isn't a more elegant way to handle invalid logons.
Thu, May 21 2015 2:25 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/21/2015 1:32 PM, Mike wrote:
> It is working but still have questions if there isn't a more elegant way to handle invalid logons.

What do you have in mind ?

If the login failed then either you either need to ask user to provide
new credentials (if interactive app) or app is done and can't continue.

You have full of control of the process.

Raul


Thu, May 21 2015 5:06 PMPermanent Link

Mike

Maybe setting a property IsConnected instead of a exception.

Like I said it is working but don't using an exception for this.
Thu, May 21 2015 5:10 PMPermanent Link

Mike

Must be

Like I said it is working but don't want to use an exception for this.
Thu, May 21 2015 9:12 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/21/2015 5:10 PM, Mike wrote:
> Like I said it is working but don't want to use an exception for this.

I see.

How would you then find out what type of error it is ?

Login failure is just one type of problem you might encounter with
connections - there are network issues (ip, port), unicode/ansi issues,
encryption issues etc.

It looks to me you're asking for windows api style error where you see
false result on connection status and then would have to go and retrieve
the last error code (and then maybe even retrieve the error message).

My preference is the exception model - i think it makes for cleaner code
and more flexibility (i.e. easy to re-raise and exception if need to
pass it to calling function etc)

Raul
Image