PC Review


Reply
Thread Tools Rate Thread

Call DotNet Application From Access - Cannot Release Dotnet Application

 
 
Derek Hart
Guest
Posts: n/a
 
      1st Dec 2005
Help!



I cannot get my DotNet application to shut down as an automation server from
Access.



I have the following simple code in Access that I am using to call a VB.NET
application:



Dim w As Object
Set w = CreateObject("MyProgram.MyProgramClass")
w.MyProgramDoSomething
Set w = Nothing



I have tried many things in DotNet. The final lines of the application are
the following:



System.GC.Collect()

System.GC.WaitForPendingFinalizers()



When I run the above code in Access to call the program, it runs it, which
opens up a DotNet WindowsForm, and then I shut down the WindowsForm, and
when I run the Access code again, it runs the DotNet app again, but the
DotNet app was never fully released. For example, Datasets that were filled
with data get added to, and the data is doubled! Task manager does not show
that the program is running, but Access still holds a connection. By the
way, if I exit Access and open it up again and run the above code, it works
fine. How do I properly exit the DotNet app?



Thank You,

Derek Hart


 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      2nd Dec 2005
>From my viewpoint as an Access VBA guy, that should work fine. (But I
don't know anything about .NET.)

How about this as a long shot. Access itself has a property,
UserControl, of the Application object. If you automate Access, and
make the automated instance visible, then set UserControl=true, that
instance will not go away when you set the object variable to nothing.
So maybe, .NET (or its forms) has a similar property, which is
automagically set True when the instance becomes visible? If so, maybe
you could set that property back False before you drop the object
reference.

As I say, this is nothing more than a stab in the dark.

(Snipped microsoft.public.access.modulescoding, cos google groups would
not post there.)

HTH,
TC

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open a FORM in MS Access Application from DotNet Code Wisdom Microsoft Access Forms 1 31st Jan 2008 07:03 PM
Upgrading Access 97 application to dotNet kavsak Microsoft VB .NET 38 5th Dec 2006 10:12 PM
Call dotnet from a vb6 application Ruth Microsoft VB .NET 3 17th Aug 2006 08:06 PM
Access Violation in dotnet application =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= Microsoft Dot NET Framework 5 24th Jan 2006 10:08 AM
What is the advantage to porting MFC application to pure dotnet application jeff Microsoft VC .NET 0 10th Dec 2003 10:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 PM.