Compacting an Access 97 DB from VB.NET 2003
Hi everybody,
Here's my code,
Imports System.IO Public Shared Sub RepairCorruptDatabase(ByRef corruptDB As FileInfo, ByVal destinationFileName As String) End Class
Public Class Access97Routines
Dim accessApp As New Access.Application
Try
accessApp.DBEngine.CompactDatabase(corruptDB.FullName, destinationFileName)
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Critical, App.Title)
Finally
accessApp.Quit()
End Try
End Sub
Me problem be that the Access application remains open no matter what, even if I set the accessApp var = nothing. But when I close my app then the Access app that I instantiated is destroyed and goes away.
I thought of explicitly destroying the access app while I have a reference to it but I don't know if you can do that or how to do it. And the Access.Application object doesn't support the .Dispose method because it is an interop assembly.
Could someone please help and point me in the right direction?
Thanks a lot.
Andeezle

