MS Access 2000 Automation from VB.NET, can't quit process...

D

David Conorozzo

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

Peter Huang

Hi Dave,

Thanks for posting in the community.

I have replied to your post in the group below.

Subject: MS Access 2000 Automation, can't quit process...
Newsgroups: microsoft.public.dotnet.framework.windowsforms

Please go and take a look, if you have any concern on that issue, please
post there.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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