Hi have a weird one here.
I have an Access 2010 database. I wanted to provide some functionality that was better suited to write in .Net. So, I went and wrote a very simple DLL. I compiled this object and deployed onto the target machine.
In access I can see the DLL and I am able to reference it through the normal process.
One of the functions this DLL provides is a simple SMTP interface to allow me to send an email from Access. The code in Access is as follows: -
Dim MyMailer As New CareControlSystems.CareControlEmail
MyMailer.SendEmail EmailAddress, EmailName, EmailMessage
Set MyMailer = Nothing
In my .Net DLL I am making sure that any references that I create are being properly dealt with, in this case the code is: -
smtpClient.Send(message);
smtpClient.Dispose();
smtpClient = null;
(this is c# code).
The odd thing is when I use my code it works fine, every time. It can be repeated again and again. However, if I try and shut down Access it will close the database and then automatically open the MSAccess software (it does not open the database, just the interface for me to open a database). Every time you shut it down it reopens itself. The only way to shut it down is through the Task Manager and to kill the MCACCESS.exe process.
This "not shutting down" behaviour is only present after the DLL is used once.
My thought process is that although I have set the reference within access to "nothing", a thread is still active from the DLL which is causing Access not to shut down.
Has anyone come accross this before? Is there a way of nuking all the references so that access can be shut down?
I have an Access 2010 database. I wanted to provide some functionality that was better suited to write in .Net. So, I went and wrote a very simple DLL. I compiled this object and deployed onto the target machine.
In access I can see the DLL and I am able to reference it through the normal process.
One of the functions this DLL provides is a simple SMTP interface to allow me to send an email from Access. The code in Access is as follows: -
Dim MyMailer As New CareControlSystems.CareControlEmail
MyMailer.SendEmail EmailAddress, EmailName, EmailMessage
Set MyMailer = Nothing
In my .Net DLL I am making sure that any references that I create are being properly dealt with, in this case the code is: -
smtpClient.Send(message);
smtpClient.Dispose();
smtpClient = null;
(this is c# code).
The odd thing is when I use my code it works fine, every time. It can be repeated again and again. However, if I try and shut down Access it will close the database and then automatically open the MSAccess software (it does not open the database, just the interface for me to open a database). Every time you shut it down it reopens itself. The only way to shut it down is through the Task Manager and to kill the MCACCESS.exe process.
This "not shutting down" behaviour is only present after the DLL is used once.
My thought process is that although I have set the reference within access to "nothing", a thread is still active from the DLL which is causing Access not to shut down.
Has anyone come accross this before? Is there a way of nuking all the references so that access can be shut down?