Invalid password exception handling (EMysqlException error)

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
[email protected]
Posts: 2
Joined: Tue 28 Feb 2006 18:05

Invalid password exception handling (EMysqlException error)

Post by [email protected] » Tue 28 Feb 2006 18:12

I'm new to these components so I apologize, but I need help handling a wrong password exception from the MyConnection and MyConnectDialogue. With correct username and password, the applicatio nruns fine, however, an invalid password gives te following error:

"Project myproject.exe raised exception class EMySqlException with
message #280000Access denied for user 'User1@localhost' using
password:YES'. Process stopped. Use Step or Run to continue"

It's probably a quick fix, that I can't see, but any help is appreciated.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Re: Invalid password exception handling (EMysqlException error)

Post by eduardosic » Tue 28 Feb 2006 20:24

[email protected] wrote:I'm new to these components so I apologize, but I need help handling a wrong password exception from the MyConnection and MyConnectDialogue. With correct username and password, the applicatio nruns fine, however, an invalid password gives te following error:

"Project myproject.exe raised exception class EMySqlException with
message #280000Access denied for user 'User1@localhost' using
password:YES'. Process stopped. Use Step or Run to continue"

It's probably a quick fix, that I can't see, but any help is appreciated.
What version of myDAC and mySQL server?

the information is very important.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 01 Mar 2006 09:37

To handle this error try using somethig like this:

Code: Select all

  try
    MyConnection.Connect;
  except
    on e: EMyError do
      if E.Errorcode = ER_ACCESS_DENIED_ERROR then
        MessageDlg('Wrong username or password', mtError, [mbOK], 0)
      else
        raise;
  end;
Dont forget to include MyClasses and MyCall units into the project.

[email protected]
Posts: 2
Joined: Tue 28 Feb 2006 18:05

Post by [email protected] » Wed 01 Mar 2006 17:29

Version 4.3 myDAC with version 4.1 mySQL

Post Reply