//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.