Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    deleting databases (Access 2000)

    I want to delete a database if this database exists.I have a function that deletes a single database if it exists but i cannot cope with the situation to delete several databases if they exist.My code deletes only the first available database, but the second etc available databases are not deleted.My function is the following

    Public Function DeleteDBIfAvailable()
    If Dir(bappathLondon, vbNormal) <> "" Then
    Kill (bappathLondon
    End If
    If Dir(bappathBerlin, vbNormal) <> "" Then
    Kill (bappathBerlin)
    End If
    End Function
    ( BappathLondon and bappathBerlin are the the paths of the databases as: Public Const bappathLondon As String =

    "C:beDepotLondon.mdb'")

    In order to explain myself better, i have to import some tables from a database if it does exists,for example the dtabase DepotLondon.mdb

    and aftwer that delete it.If the database is not available, than nothing happens.I can do it with a single h database,for example the dtaabase for London,but if several databases are available,than i cannot handle the situation.I delete only the first database. I cannot perrform an ElseIf condition
    I will be grateful for any help

  2. #2
    Star Lounger
    Join Date
    Dec 2001
    Location
    Fredensborg, Denmark
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: deleting databases (Access 2000)

    Except for a missing ")" in your first Kill stmt your code seems OK. Check the spelling of the path names in your consts defining the dbs.

Posting Permissions

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