Réponse acceptée !
Salut,
oui. il faut faire ce qu l'on appelle un "packtable" sur la table qui doit être ouverte avec Exclusive à true.
Uses BDE;
function TablePackTable(Tab: TTable): Boolean;
var Activ, Excl : Boolean;
begin
Result := false;
Activ := Tab.Active;
Excl := Tab.Exclusive;
try
if not Tab.Exclusive then
begin
Tab.Active := false;
Tab.Exclusive := True;
end;
if not Tab.Active then
Tab.Active := True;
DbiPackTable(Tab.DbHandle, Tab.Handle, Nil, SzDBase, True);
Result := True;
except
end;
if not Excl then
begin
Tab.Active := false;
Tab.Exclusive := false;
end;
Tab.Active := Activ;
end;
A+
Composants Cindy pour Delphi
Faites une donation.