Page 1 of 1

EDAError

Posted: Sun 01 Nov 2015 07:59
by davor.TCS

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?

Re: EDAError

Posted: Mon 02 Nov 2015 16:00
by ViktorV
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.