Close external Access DB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to close an external Access DB that was not open by the current DB?

I posted the same question in Mudules sesstion, which I found is not very
active.

Great thanks,

Shirley
 
Hi,

try this code

Function CloseExDatabase(DbName As String) As Boolean
Dim oApp As Object

On Error Resume Next
Set oApp = GetObject(DbName)
On Error GoTo 0

If Not oApp Is Nothing Then
oApp.CloseCurrentDatabase
oApp.Quit
Set oApp = Nothing
CloseExDatabase = True
End If

End Function



Saludos,
Juan M Afan de Ribera
[MVP Access]
http://www.mvp-access.com/juanmafan
 
Back
Top