EDAError

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
davor.TCS
Posts: 29
Joined: Thu 05 Apr 2012 22:10
Contact:

EDAError

Post by davor.TCS » Sun 01 Nov 2015 07:59

Code: Select all

procedure TDM.MyConnError(Sender: TObject; E: EDAError; var Fail: Boolean);
begin  
  case E.ErrorCode of
    1053: ShowMessage('Server shutdown in progress!');
    2003: ShowMessage('Can not connect to MySQL server!');
    2013: ShowMessage('Lost connection on query!'); 
    1045: ShowMessage('Access denied! Check password!'); 
    1049: ShowMessage('DB does not exists!'); 
    1051: ShowMessage('Table does not exists!'); 
    else ShowMessage(E.Message);
  end;
  Fail:=false;
end;
Is there any way to make this more descriptive?
For example error 1054, unknown column 'xxxx' in table 'yyyy', and so on?
Or perhaps a better way to show what error and where it occured?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: EDAError

Post by ViktorV » Mon 02 Nov 2015 16:00

You can return an error message immediately using the EDAError.Message property. If the error message doesn't contain any additional information, please specify the missing information.

Post Reply