MS Access 2000 Automation, can't quit process... (originally posted to wrong group).

G

Guest

I create a new Access.Application instance. As soon as I refernce the property "References", I am unable to issue a truly successful quit on that instance. By that I mean the call to quit is fine but if you look in task manager, the instance is still running. Furthermore, if you opened a database using that instance, you will not be able to open it until you quit the entire application or until you kill that process. BTW, the process is killed automatically on successful exit of the application (but it doesn't get killed if you simply go out of scope). I am interested in whether or not this is a real bug, or if there is a service pack or if it affects other versions of Access. To replicate

Create a new Windows Form Application. Add a reference to the Microsoft Access 9.0 Object Library COM component (this will automatically add some other references). Add a button to your form. In the click event for that button do something like (VB.NET)
Dim o As Access.Applicatio
o = New Access.Applicatio
o.OpenCurrentDatabase("c:\somedb.mdb", False
Dim x as Integer = o.References.Coun
o.CloseCurrentDatabase(
o.Qui

Set a breakpoint on the End Sub line. Open task manager and you should see an instance of MSACCESS.EXE still running
Let the program get out of the Sub (exit that scope) and you will see that the instance is still running. Exit the application normally (no errors, don't kill the application) and you will see that the OS properly kills the instance with the application

Run this again but take out the line: "Dim x as Integer = o.References.Count" and you will see that at the end of the sub, the instance is not there. I have a bunch of code like this and no other lines are causing this to happen, i.e. if I take out the few lines of code that reference "References", all instances of MSACCESS.EXE exit properly
 
P

Paul Clement

¤ I create a new Access.Application instance. As soon as I refernce the property "References", I am unable to issue a truly successful quit on that instance. By that I mean the call to quit is fine but if you look in task manager, the instance is still running. Furthermore, if you opened a database using that instance, you will not be able to open it until you quit the entire application or until you kill that process. BTW, the process is killed automatically on successful exit of the application (but it doesn't get killed if you simply go out of scope). I am interested in whether or not this is a real bug, or if there is a service pack or if it affects other versions of Access. To replicate:
¤
¤ Create a new Windows Form Application. Add a reference to the Microsoft Access 9.0 Object Library COM component (this will automatically add some other references). Add a button to your form. In the click event for that button do something like (VB.NET):
¤ Dim o As Access.Application
¤ o = New Access.Application
¤ o.OpenCurrentDatabase("c:\somedb.mdb", False)
¤ Dim x as Integer = o.References.Count
¤ o.CloseCurrentDatabase()
¤ o.Quit
¤
¤ Set a breakpoint on the End Sub line. Open task manager and you should see an instance of MSACCESS.EXE still running.
¤ Let the program get out of the Sub (exit that scope) and you will see that the instance is still running. Exit the application normally (no errors, don't kill the application) and you will see that the OS properly kills the instance with the application.
¤
¤ Run this again but take out the line: "Dim x as Integer = o.References.Count" and you will see that at the end of the sub, the instance is not there. I have a bunch of code like this and no other lines are causing this to happen, i.e. if I take out the few lines of code that reference "References", all instances of MSACCESS.EXE exit properly.

See the following:

PRB: Office Application Does Not Quit After Automation from Visual Studio .NET Client
http://support.microsoft.com/default.aspx?scid=kb;en-us;317109&Product=vbNET


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top