procedure PackTable(Table: TTable);
var
Props: CURProps;
hDb: hDBIDb;
Begin
if not Table.Active then raise EDatabaseError.Create;
{'Table必需已经打开'}
if not Table.Exclusive then raise EDatabaseError.Create;
{'Table必需以独占方式打开'}
Check(DbiGetCursorProps(Table.Handle, Props));
if (Props.szTableType = szDBASE) then
Check(DbiPackTable(Table.DBHandle,
Table.Handle, nil, szDBASE, True))
else raise EDatabaseError.Create;
{'Table必需是dBASE或FoxPro类型'}
Table.Open;
End;