> This is normal, SQL errors raise an exception.
>

Procedure tmysqlconnection.checkerror(const Msg: String; const aconn: pmysql);
var
 str1: msestring;
begin
 str1:= connectionmessage(mysql_error(aconn));
 flasterrormessage:= str1;
 flasterror:= mysql_errno(aconn);
 flastsqlcode:= strpas(mysql_sqlstate(aconn));
 raise emysqlerror.create(self,format(msg,[str1]),flasterrormessage,
                      flasterror,flastsqlcode); ==========> here
end;

But  raise exception always stop all process, so I can't rollback the
part of record has been saved. And integrity of record is broken.
I try to change my code with :

 tmsesqlquery1.applyupdates; ====> the process stop here!!!
 if tmsemysqlconnection1.lasterror=0 then begin
  tmsesqlquery1.trans.commitretaining;
end else begin
 tmsesqlquery1.trans.rollbackretaining; ====> but this command does
not executed.
end;
_______________________________________________
MSEide-MSEgui-talk mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mseide-msegui-talk

Reply via email to