• deleting databases (Access 2000)

    Author
    Topic
    #365635

    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

    Viewing 0 reply threads
    Author
    Replies
    • #564791

      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.

    Viewing 0 reply threads
    Reply To: deleting databases (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: