How to catch all exceptions?
Posted: Wed 01 Jan 2014 20:23
Query1 := TUniQuery.Create(Owner);
Query1.Connection:=DM.Connection;
MainForm.ds1.DataSet:=Query1;
try
with Query1 do
begin
SpecificOptions.Values['MySQL.FetchAll'] := 'True';
SQL.Clear;
SQL.Add('update users set u_pass=''xxxxxxx'' where u_name=sssss'); // u_name is string
Execute;
end
except
on E:Exception do begin
// raise EDatabaseError.Create(E.Message);
ShowMessage(E.ClassName+' error raised, with message : '+E.Message);
end;
end;
// unidac 5.1.4
--------------------------------------------------------------
But the result is not stable, there are three different windows like these cases if I always execute the same SQL above. Why?



Attention, the last picture is so strange. It cover the whole sreen, including the statusbar of windows(not statusbar of my application).
I hope the error window always like the first one.
Help me, thanks.
Query1.Connection:=DM.Connection;
MainForm.ds1.DataSet:=Query1;
try
with Query1 do
begin
SpecificOptions.Values['MySQL.FetchAll'] := 'True';
SQL.Clear;
SQL.Add('update users set u_pass=''xxxxxxx'' where u_name=sssss'); // u_name is string
Execute;
end
except
on E:Exception do begin
// raise EDatabaseError.Create(E.Message);
ShowMessage(E.ClassName+' error raised, with message : '+E.Message);
end;
end;
// unidac 5.1.4
--------------------------------------------------------------
But the result is not stable, there are three different windows like these cases if I always execute the same SQL above. Why?
Attention, the last picture is so strange. It cover the whole sreen, including the statusbar of windows(not statusbar of my application).
I hope the error window always like the first one.
Help me, thanks.