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