Invalid password exception handling (EMysqlException error)

Invalid password exception handling (EMysqlException error)

Postby davidg@gglocksafe.com » 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.
davidg@gglocksafe.com
 
Posts: 2
Joined: Tue 28 Feb 2006 18:05

Re: Invalid password exception handling (EMysqlException error)

Postby eduardosic » Tue 28 Feb 2006 20:24

davidg@gglocksafe.com 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.
eduardosic
 
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Postby 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.
Antaeus
 
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Postby davidg@gglocksafe.com » Wed 01 Mar 2006 17:29

Version 4.3 myDAC with version 4.1 mySQL
davidg@gglocksafe.com
 
Posts: 2
Joined: Tue 28 Feb 2006 18:05


Return to MySQL Data Access Components