One small point. If the database is password protected
VB Code:
  1. DBEngine.CompactDatabase Location, strTempFile, , , ";pwd=YourPassword"