//This function Pack the Paradox table. write by zodiac void __fastcall TForm1::PackParadoxTable(hDBIDb hDB, AnsiString TblName) { //Paradox table use a quite different way to be packed than //DBase or Foxpro table, it use the DBiDoRestructure not the // DBiPackTable DBIResult rslt; CRTblDesc TblDesc; //filled the structure CRTbiDesc with 0 memset((void *)&TblDesc,0,sizeof(CRTblDesc)); //copy the table name and type to the structure lstrcpy(TblDesc.szTblName,TblName.c_str()); lstrcpy(TblDesc.szTblType,szPARADOX); //set bPack to true to specify Pack Function TblDesc.bPack=true; //Pack the table rslt=DbiDoRestructure(hDB,1,&TblDesc,NULL,NULL,NULL,false); if(rslt!=DBIERR_NONE) application->MessageBox("不能壓縮表","壓縮數據表出錯",MB_ICONERROR); } 注重,在Restructure之前,表必須處于關閉狀態。以下例程調用PackParadoxTable.