procedure ParadoxPack(InTable : TTable); // PARADOX icin
var
bHoldExcl : boolean;
bHoldStat : boolean;
ResCode : DBIResult;
EMessage : DBIMSG;
PdoxTableDesc : CRTblDesc;
begin
ResCode := DBIERR_NONE;
with InTable do
begin
bHoldExcl := Exclusive;
bHoldStat := Active;
Close;
Exclusive := true;
Open;
end;
FillChar( PdoxTableDesc, SizeOf(CRTblDesc), 0);
StrPCopy( PdoxTableDesc.szTblName, InTable.TableName);
PdoxTableDesc.bPack := true;
ResCode := DbiDoRestructure(InTable.DBHandle,
1,
@PdoxTableDesc,
nil,
nil,
nil,
false);
if ResCode <> DBIERR_NONE then
begin
DbiGetErrorString( ResCode, EMessage );
ShowMessage( EMessage );
end;
with InTable do
begin
Close;
Exclusive := bHoldExcl;
Active := bHoldStat;
end;
end;
procedure dbasePack(InTable : TTable); // DBASE icin
var
bHoldExcl : boolean;
bHoldStat : boolean;
ResCode : DBIResult;
EMessage : DBIMSG;
begin
with InTable do
begin
bHoldExcl := Exclusive;
bHoldStat := Active;
Close;
Exclusive := true;
Open;
end;
ResCode := DbiPackTable(InTable.DBHandle,
InTable.Handle,
nil,
nil,
True);
if ResCode <> DBIERR_NONE then
begin
DbiGetErrorString( ResCode, EMessage );
ShowMessage( EMessage );
end;
with InTable do
begin
Close;
Exclusive := bHoldExcl;
Active := bHoldStat;
end;
end;
// Kemal GÜLOL