unit DataUnit;

interface

uses
  SysUtils, Classes, dialogs, DBAccess, DB, MySQLUniProvider, Uni, MemDS,
   DASQLMonitor,
  WideStrings, DBXMySql, SqlExpr, UniDacVcl, UniSQLMonitor;

type
  TSQL_DM = class(TDataModule)
    mysql_query1: TUniQuery;
    mysql_query2: TUniQuery;
    MySQL_mon: TUniSQLMonitor;
    mysql_DSQ2: TUniDataSource;
    mysql_DSQ1: TUniDataSource;
    mysql_conn_dialog: TUniConnectDialog;
    mysql_query3: TUniQuery;
    mysql_DSQ3: TUniDataSource;
    mysql_DSQ4: TUniDataSource;
    mysql_query4: TUniQuery;
    mysql_DSQ5: TUniDataSource;
    mysql_query5: TUniQuery;
    mysql_con: TUniConnection;
    mysql_DSQ6: TUniDataSource;
    mysql_query6: TUniQuery;
    mysql_query_sp_DS: TUniDataSource;
    mysql_query_sp: TUniQuery;
    procedure mysql_conError(Sender: TObject; E: EDAError; var Fail: Boolean);
    procedure mysql_query1PostError(DataSet: TDataSet; E: EDatabaseError;
      var Action: TDataAction);
    procedure mysql_conBeforeConnect(Sender: TObject);
    procedure MySQL_monSQL(Sender: TObject; Text: string; Flag: TDATraceFlag);
    procedure mysql_query4PostError(DataSet: TDataSet; E: EDatabaseError;
      var Action: TDataAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SQL_DM: TSQL_DM;



implementation

uses ConstUnit;

{$R *.dfm}

procedure TSQL_DM.mysql_conBeforeConnect(Sender: TObject);
begin
//mysql_con.Options.Charset:='cp1251';
end;

procedure TSQL_DM.mysql_conError(Sender: TObject; E: EDAError;
  var Fail: Boolean);
 begin
if (report_error=2) then showmessage (inttostr(E.ErrorCode)+'  '+E.Message);

end;

procedure TSQL_DM.MySQL_monSQL(Sender: TObject; Text: string;
  Flag: TDATraceFlag);
begin
//
end;

procedure TSQL_DM.mysql_query1PostError(DataSet: TDataSet; E: EDatabaseError;
  var Action: TDataAction);
begin
if (report_error=2) or (report_error=1) then showmessage(E.Message);

end;

procedure TSQL_DM.mysql_query4PostError(DataSet: TDataSet; E: EDatabaseError;
  var Action: TDataAction);
begin
if (report_error=2) or (report_error=1) then showmessage(E.Message);
end;

end.
