!!!

解决方案 »

  1.   

    function dgPackParadoxTable(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; function dgPackDbaseTable(Tbl: TTable): DBIResult; { Pack a dBASE table by calling DbiPackTable. The table 
    passed as a parameter will be opened if it isn't open. } 
    begin 
      Result := DBIERR_NA; 
      if Tbl.Active = False then 
        Tbl.Open; 
      Result := DbiPackTable(Tbl.DBHandle, Tbl.Handle, 
        nil, nil, True); 
    end; 
    ****************************
    要压缩dBase数据库很简单,只要下面的操作即可:
    DBIPackTable(Table1.DbHandle, Table1.Handle, 'TABLENAME.DBF', szDBASE, TRUE);
    当然,Table必须用exclusive方式打开!
      

  2.   

    我要知道的是需要包括什么头文件
    如.db.pas 什么的
      

  3.   

    只需use bde;就可以,但我不知道是否真能压缩。