Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete all databases in a directory (Access 2000)

    I want to build a function that kills all the databases ending .mdb and also .zip in a given direcotry using the path name as a constant. My constant ia called FPath.Is it possible ?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Delete all databases in a directory (Access 2000)

    Do you want to delete all .mdb files in a nominated folder?

    Any other files you want to delete as well?

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete all databases in a directory (Access 2000)

    These two lines of code should do what you want:
    <code>
    Kill FPath & "*.mdb"
    Kill FPath & "*.zip"
    </code>
    Be careful! The code will delete the files without asking for confirmation, and the files will be deleted permanently, they will not be moved to the Recycle Bin. So always make a backup copy of the folder before testing the code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •