paradox就是这样的,不但graphic类型的清不掉,就是alpha(String)类型的也一样,不信你做个10000条记录的表然后删5000,表的大小不减小,表里没有graphic字段也一样
这是因为paradox吧记录删除之后会有个“空位”
有个方法是将paradox的表压缩(清掉),不过没试过
uses DBIProcs, DBITypes, DBIErrs;
function PackTable(tbl:TTable; db:TDatabase)
BIResult;
var
crtd: CRTblDesc;
begin
Result := DBIERR_NA;
with tbl do if Active then Active := False;
with db do if not Connected then Connected := True;
FillChar(crtd,SizeOf(CRTblDesc),0);
StrPCopy(crtd.szTblName,tbl.TableName);
crtd.bPack := True;
Result := DbiDoRestructure(db.Handle,1,@crtd,nil,nil,nil,FALSE);
end;
Example of use:
procedure TForm1.Button1Click(Sender: TObject);
begin
if PackTable(Table1,DataBase1) = DBIERR_NONE then .....
else MessageBeep(0);
end;