Как паковать таблицу?
Как паковать таблицу?
functiondgPackParadoxTable(Tbl: TTable; Db: TDatabase): DBIResult;
{Packs a Paradox table by calling the BDE DbiDoRestructure function. The TTable passed as the first parameter must be closed. The TDatabase passed as the second parameter must be connected.}
var
TblDesc: CRTblDesc;
begin
Result := DBIERR_NA;
FillChar(TblDesc, SizeOf(CRTblDesc), 0);
StrPCopy(TblDesc.szTblName, Tbl.TableName);
TblDesc.bPack := True;
Result := DbiDoRestructure(Db.Handle, 1, @TblDesc, nil, nil, nil, False);
end;
Взято с
Delphi Knowledge Baseuses
DbiProcs;
with Table do
begin
OldState := Active;
Close;
Exclusive := True;
Open;
DbiPackTable(DBHandle, Handle, nil, nil, True);
{^ здесь можно добавить check()}
Close;
Exclusive := False;
Active := OldState;
{ при желании можно сохранить закладку }
end;
Nomadic