Removes the entire database, the mdb database (Access), but the file size does not change. Why?

begin try ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add('DELETE FROM db'); ADOQuery1.ExecSQL; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add('SELECT * FROM db'); ADOQuery1.Active:=True; except on e:Exception do end; 
  • @Skaynet; To format a code, select it with the mouse and click on the {} button of the editor. - Nicolas Chabanovsky

1 answer 1

I suppose you need to compress the base. DBMS usually increase the data file when adding records, but do not compress when deleting (and why - it will grow anyway). So the data file compression is the usual servicing procedure on the conscience of the admin or task scheduler.