Q:如何重整(pack) DBase 及 Paradox 資料表? A:參考下列程式碼: (必須 Use BDE) // // Pack DBASE table // procedure PackTable(const sDbName, sTableName, : string); var SearchRec: TSearchRec; iFindResult: integer; tblBePack: TTable; begin tblBePack := TTable.Create(nil); with tblBePack do begin DatabaseName := sDbName; TableName := sTableName; TableType := ttDBase; Exclusive := True; Open; Application.ProcessMessages; DbiPackTable(DBHandle, Handle, nil, nil, True); Application.ProcessMessages; Close; Free; end; end; Re-index 我直接從 BDE API help 中將其範例剪下來: ------------------------------------------------------------------- This example uses the following input: fDbiRegenIndex(Table1, 'ByCompany', '', 1); Procedure fDbiRegenIndex(Tbl: TTable; IndexName, TagName: String; IndexNum: Word); begin Check(DbiRegenIndex(Tbl.DBHandle, nil, PChar(Tbl.TableName), nil, PChar(IndexName), PChar(TagName), IndexNum)); end; -------------------------------------------------------------------