Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Kill command (Access 20007)

    How can i kill all the previous databases with any dates ?
    My code only creates the db but does not delete them
    If Dir("c:BEwarehouse" & Format(Date, "dd-mm-yyyy") & ".mdb", vbNormal) <> "" Then
    Kill ("c:BEwarehouse" & Format(Date, "dd-mm-yyyy") & ".mdb")
    End If
    Call ANewDB("c:BEwarehouse")

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

    Re: Kill command (Access 20007)

    Kill supports the use of wildcard characters: <code>*</code> stands for any number of characters, and <code>?</code> for a single character. The instruction
    <code>
    Kill "c:BEwarehouse*.mdb"
    </code>
    will delete ALL databases in C:BE whose name begins with warehouse. If you only want to delete those whose name follows the pattern of a date, use
    <code>
    Kill "c:BEwarehouse??-??-????.mdb"
    </code>
    Note that there is no need to place parentheses ( ) around the path and filename.

Posting Permissions

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