Possibly on the first line, DB.CLOSE, but that assumes that you have the database open before calling this sub.

Also, if there are multiple users of this database, you cannot get exclusive access to the file and will not be able to compact it unless everyone else who is using the database has also closed their reference to it