AnyDAC
ContentsIndexHome
PreviousUpNext
EADDBEngineException Class

EADDBEngineException is the base exception class for all AnyDAC DBMS related errors.

Group
Class Hierarchy
uADStanError_EADDBEngineExceptionuADStanError_EADDBEngineException
File

uADStanError

Links

An EDBEngineException object is used as:

  • an exception object, raised when a DBMS operation produces an error condition;
  • an object describing a warning, stored at connection when a DBMS operation produces an warning condition;
  • and object representing a message, stored at connection when a DBMS operation sends a message to a client.

Its Errors property contains TADDBError objects. Each of them corresponds to a single error, warning or message item, produced inside of a single DBMS operation. The Kind property returns DBMS-independent error kind. The SQL and Params properties allows to get a failed SQL command. 

All AnyDAC drivers are implementing own EADDBEngineException descendant classes. For example, MySQL driver implements EMySQLNativeException exception class. 

Use a TADGUIxErrorDialog dialog to display the complete information about AnyDAC / DBMS error.

EADDBEngineException = class(EADException);
uses
  uADStanError;
......
try
  ADQuery1.ExecSQL;
except
  on E: EADDBEngineException do
    if E.Kind = ekUKViolated then begin
      ShowMessage('The record must be unique');
      Abort;
    end;
end;
What do you think about this topic? Send feedback!