请问:delphi5自带的paradox表最多可以支持多少条记录,我其中有一个表预计达到20万条,不知在这种条件下,我检索记录的时间会有多慢,非常感谢!!

解决方案 »

  1.   

    要压缩一个Paradox数据库(物理删除),请参考下面的代码! 
    { METHOD: PackParadoxTablePURPOSE: Pack the currently opened paradox table.}procedure TTableEnhanced.PackParadoxTable;var{ Specific information about the table structure, indexes, etc. }TblDesc: CRTblDesc;{ Uses as a handle to the database }hDb: hDbiDb;{ Path to the currently opened table }TablePath: array[0..dbiMaxPathLen] of char;beginhDb := nil;{ Initialize the table descriptor }FillChar(TblDesc, SizeOf(CRTblDesc), 0);with TblDesc dobegin{ Place the table name in descriptor }StrPCopy(szTblName, TableName);{ Place the table type in descriptor }StrCopy(szTblType, GetTableType);{ Set the packing option to true }bPack := True;end;{ Get the current table's directory. This is why the table MUST beopened until now }Chk(DbiGetDirectory(DBHandle, True, TablePath));{ Close the table }Close;{ NOW: since the DbiDoRestructure call needs a valid DB handle BUT thetable cannot be opened, call DbiOpenDatabase to get a valid handle.Setting TTable.Active = FALSE does not give you a valid handle }Chk(DbiOpenDatabase(nil, 'STANDARD', dbiReadWrite, dbiOpenExcl, nil,0, nil, nil, hDb));{ Set the table's directory to the old directory }Chk(DbiSetDirectory(hDb, TablePath));{ Pack the PARADOX table }Chk(DbiDoRestructure(hDb, 1, @TblDesc, nil, nil, nil, FALSE));{ Close the temporary database handle }Chk(DbiCloseDatabase(hDb));{ Re-Open the table }Open;end; 
     建议压缩数据库