Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Thanked 0 Times in 0 Posts

    Kill database (Access 2000)

    Kill database

    I have a wonderful function that deletes the superflous dabases. By the way, i must mention that my function is built with the help of this superb Forum.
    I wonder can i improve my function. At first i must check up whether the database exists , and then kill it.But i must repeat that for each database.And sometimes i have a lot of databases.
    Is it possible instead to write them in brackets, for example If Dir(segment Or Dirty1 or Dirty2 or Dirty3 etc ) ?
    And then Kill them ?

    To be more clear below is he function i use for the moment :

    Public Const BEpath As String = "C:bestorebe.mdb"
    Public Const BENewpath As String = "C:bestorebeNew.mdb"
    Public Const Segment As String = "C:BESegment Exe.mdb"
    Public Const Dirty1 As String = " C BEHaTpl.mdb"
    Public Const Dirty2 As String = " C BENov.mdb"
    Public Const Dirty3 As String = "C:bestoreCopy of be.mdb"
    Public Const Dirty4 As String = "C:bestoreCopy (2) of be.mdb"

    Public Function DeleteFiles()

    If Dir(Segment, vbNormal) <> "" Then
    Kill (Segment)
    End If

    If Dir(Dirty1, vbNormal) <> "" Then
    Kill (Dirty1)
    End If

    etc, etc.......

    End Function

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 41 Times in 40 Posts

    Re: Kill database (Access 2000)

    Use Wildcards.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Kill database (Access 2000)

    If you want to delete all databases in certain folders, it would be easier. The situation you sketch doesn't lend itself to generalization.

Posting Permissions

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