Suite à des insonmie je me suis mis dedans illico, malgre le rajout IBSQL_mvt.transaction.StartTransaction;
dans ma function function TFonc_Client.Insertion_ou_MAJ(instruction: string): BOOLEAN;
Alors pour l'instant je contourne le probleme j'ai ecris une fonction que pour la recherche multicritere :
//==============================================================================
// Recherche Multicritere
//==============================================================================
function TFonc_Client.Recherche_Multi(instruction: string): BOOLEAN;
begin
with FICHE, DM do
begin
try
Client.Active := False;
Client.SQLs.SelectSQL.Clear;
Client.SQLs.SelectSQL.Add(Instruction);
Client.Active := True;
except
Exit;
end;
end;
end;
//==============================================================================
//==============================================================================
// Convertion signe * en Pourcent
//==============================================================================
function o_StrRemChar(const _str: string; _char: Char; _case: Boolean = False): string;
var
x: Integer;
f_s: string;
f_c: string;
begin
Result := '';
f_s := _str;
f_c := _char;
if _case then
begin
f_s := Ansiuppercase(f_s);
f_c := Ansiuppercase(f_c);
end;
for x := 1 to Length(_str) do
if f_s[x] <> f_c then
Result := Result + _str[x] else
Result := Result + '%';
end;
//==============================================================================
// et dans mes champ Edit je recherche directement sur le FIBDataset sans passer par le FIBTransaction
//==============================================================================
// Convertion signe * en Pourcent
//==============================================================================
Procedure TFICHE.EC1KeyPress(Sender: TObject; var Key: Char);
var C1, C2, C3, C4: string;
begin
if Key = #13 then
begin
C1 := o_StrRemChar(EC1.Text, '*');
C2 := o_StrRemChar(EC2.Text, '*');
C3 := o_StrRemChar(EC3.Text, '*');
C4 := o_StrRemChar(EC4.Text, '*');
Fonc_Client.Insertion_ou_MAJ('Select * From CLIENT where (FICHE LIKE ''%'
+ C1 + '%'') And (CP LIKE ''%'
+ C2 + '%'') And (VILLE LIKE ''%'
+ C3 + '%'') And (TELEPHONE LIKE ''%'
+ C4 + '%'') Order by FICHE ASC ');
if DM.CLIENTNFiche.Text = '' then
begin
Fonc_Client.Recherche_Multi('Select * From CLIENT Order By FICHE ASC');
end else
begin
DBGCLIENT.SetFocus;
end;
Key := #0;
end;
end;
//==============================================================================
Voila avec ca j'ai bien mes trie sur 4 champs, donc ma question quel est l'interet de la Tansaction?
Beau Temps Belle Mer