Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    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
    Thanked 31 Times in 31 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
    Kill "c:BEwarehouse*.mdb"
    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
    Kill "c:BEwarehouse??-??-????.mdb"
    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