1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| var
x_i : integer;
x_ok : boolean;
truc : string;
begin
x_ok:=False;
x_i:=0;
while not x_ok do
begin
inc(x_i);
try
x_ok:=True;
if uppercase(trim(lancer))='EXECSQL' then qq.execSql;
if uppercase(trim(lancer))='OPEN' then qq.open;
if uppercase(trim(lancer))='EDIT' then qq.Edit;
if uppercase(trim(lancer))='POST' then qq.Post;
if uppercase(trim(lancer))='DELETE' then qq.delete;
if uppercase(trim(lancer))='APPEND' then qq.append;
if uppercase(trim(lancer))='CANCEL' then qq.cancel;
if (uppercase(trim(lancer))<>'EXECSQL') and
(uppercase(trim(lancer))<>'OPEN') and
(uppercase(trim(lancer))<>'EDIT') and
(uppercase(trim(lancer))<>'POST') and
(uppercase(trim(lancer))<>'APPEND') and
(uppercase(trim(lancer))<>'CANCEL') and
(uppercase(trim(lancer))<>'DELETE') then
FichierLog('Anomalie dans TryQuery = '+lancer);
except on e:exception do
begin
x_ok:=False;
truc:=e.message;
end;
end;
if x_i>3 then
begin
//if messageDlg(truc +#13+#10+' Ré-essayer ?',mtInformation, [mbYes, mbNo],0)=mrYes then
// x_i:=0
//else
//break;
break;
end
else
begin
if not x_ok then
begin
in_DataBase.Connected:=False; in_DataBase.Connected:=True;
end;
end;
end;
if x_i>3 then
begin
result:=False;
//if trim(mess)<>'' then messageDlg(mess, mtWarning, [mbOk], 0);
FichierLog(Mess+' - Ano= '+truc);
end
else result:=True; |
Partager