Page 1 of 1

Invalid password exception handling (EMysqlException error)

Posted: 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.

Re: Invalid password exception handling (EMysqlException error)

Posted: Tue 28 Feb 2006 20:24
by eduardosic
[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.

Posted: Wed 01 Mar 2006 09:37
by Antaeus
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.

Posted: Wed 01 Mar 2006 17:29
Version 4.3 myDAC with version 4.1 mySQL