Is there a way to compact the EDC database?

No, you cannot compact the EDC database. If your database is getting very large you can export some of your settings delete the database once you verify your current batch has been close and there are no transactions in it and then set up a new database by opening the EDC software. Once you create the new database you can import whatever settings you exported back into them.