473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Killing Access Tasks

Hello,

I have written a vb.net program that invokes an Access2000 report in
Preview mode, so that it shows on the screen. My program then goes on
its merry way and the user can read the report and close it at his
leisure.

My problem is: when I run this on Win2000 and watch it with the Task
Manager, I see it create a task for MSACCESS.EXE for the report. But
when the user closes the report, the task does not always disappear
from the Task Manager (sometimes it does).

When it hangs around, then I can't double-click on an Acess2000 MDB
database file in Windows Explorer so as to open the database.
Apparently the existing instance of the MSACCESS.EXE task gets in the
way.

If I close the dialog from which I launched the Acess2000 report,
sometimes that causes the MSACCESS.EXE task to go away, but frequently
it does not. If I close the VB program itself, that usually kills the
MSACCESS.EXE taks, but not always. Sometimes, if I repetedly invoke
reports from my program (for different customer records), I can get
multiple MSACCESS.EXE tasks going, and even though I close the
Access2000 report windows and exit the VB program, the MSACCESS.EXE
tasks remain, and the only way I can get rid of them is to kill them
from within the Task Manager.
I thought this was because of how .NET doesn't actually release memory
even though you have closed and disposed of the objects that used the
resources, but how do I force the resources to be released?
Here is the code I use to invoke the reports:

Public Sub PreviewInvoice()

Dim ac As New Access.Application

ac.OpenCurrentDatabase(oApp.DatabaseFileName)

ac.DoCmd.OpenReport("03Invoice", Access.AcView.acViewPreview,
"qry03InvoiceQuery", "[BillingEntityID]=" & Me.ID)

ac.Visible = True
ac.DoCmd.Maximize()

ac = Nothing

End Sub

Can anybody provide me with a clue here?

TIA

Nov 20 '05 #1
5 1670
Hi,

Add this after ac= nothing .
System.Runtime.InteropServices.Marshal.ReleaseComO bject(ac)

Ken
-----------------
"Dougal Fair" <do****@dougalfair.com> wrote in message
news:40****************@news.goldengate.net...
Hello,

I have written a vb.net program that invokes an Access2000 report in
Preview mode, so that it shows on the screen. My program then goes on
its merry way and the user can read the report and close it at his
leisure.

My problem is: when I run this on Win2000 and watch it with the Task
Manager, I see it create a task for MSACCESS.EXE for the report. But
when the user closes the report, the task does not always disappear
from the Task Manager (sometimes it does).

When it hangs around, then I can't double-click on an Acess2000 MDB
database file in Windows Explorer so as to open the database.
Apparently the existing instance of the MSACCESS.EXE task gets in the
way.

If I close the dialog from which I launched the Acess2000 report,
sometimes that causes the MSACCESS.EXE task to go away, but frequently
it does not. If I close the VB program itself, that usually kills the
MSACCESS.EXE taks, but not always. Sometimes, if I repetedly invoke
reports from my program (for different customer records), I can get
multiple MSACCESS.EXE tasks going, and even though I close the
Access2000 report windows and exit the VB program, the MSACCESS.EXE
tasks remain, and the only way I can get rid of them is to kill them
from within the Task Manager.
I thought this was because of how .NET doesn't actually release memory
even though you have closed and disposed of the objects that used the
resources, but how do I force the resources to be released?
Here is the code I use to invoke the reports:

Public Sub PreviewInvoice()

Dim ac As New Access.Application

ac.OpenCurrentDatabase(oApp.DatabaseFileName)

ac.DoCmd.OpenReport("03Invoice", Access.AcView.acViewPreview,
"qry03InvoiceQuery", "[BillingEntityID]=" & Me.ID)

ac.Visible = True
ac.DoCmd.Maximize()

ac = Nothing

End Sub

Can anybody provide me with a clue here?

TIA


Nov 20 '05 #2
* do****@dougalfair.com (Dougal Fair) scripsit:
I have written a vb.net program that invokes an Access2000 report in
Preview mode, so that it shows on the screen. My program then goes on
its merry way and the user can read the report and close it at his
leisure.

My problem is: when I run this on Win2000 and watch it with the Task
Manager, I see it create a task for MSACCESS.EXE for the report. But
when the user closes the report, the task does not always disappear
from the Task Manager (sometimes it does).


<http://support.microsoft.com/default.aspx?scid=kb;en-us;317109>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
On Sat, 10 Jan 2004 19:53:03 -0500, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Add this after ac= nothing .
System.Runtime.InteropServices.Marshal.ReleaseCom Object(ac)

Ken
Thank you very much - that did the trick. Except that when I added
that line *after* the ac=nothing it complained about ac not being set
to any object. So I moved the line to just *before* the ac=nothing
statement and then it appears to work fine.

Again, thanks much - it was not at ALL obvious to me how to do that.

-----------------
"Dougal Fair" <do****@dougalfair.com> wrote in message
news:40****************@news.goldengate.net...
Hello,

I have written a vb.net program that invokes an Access2000 report in
Preview mode, so that it shows on the screen. My program then goes on
its merry way and the user can read the report and close it at his
leisure.

My problem is: when I run this on Win2000 and watch it with the Task
Manager, I see it create a task for MSACCESS.EXE for the report. But
when the user closes the report, the task does not always disappear
from the Task Manager (sometimes it does).

When it hangs around, then I can't double-click on an Acess2000 MDB
database file in Windows Explorer so as to open the database.
Apparently the existing instance of the MSACCESS.EXE task gets in the
way.

If I close the dialog from which I launched the Acess2000 report,
sometimes that causes the MSACCESS.EXE task to go away, but frequently
it does not. If I close the VB program itself, that usually kills the
MSACCESS.EXE taks, but not always. Sometimes, if I repetedly invoke
reports from my program (for different customer records), I can get
multiple MSACCESS.EXE tasks going, and even though I close the
Access2000 report windows and exit the VB program, the MSACCESS.EXE
tasks remain, and the only way I can get rid of them is to kill them
from within the Task Manager.
I thought this was because of how .NET doesn't actually release memory
even though you have closed and disposed of the objects that used the
resources, but how do I force the resources to be released?
Here is the code I use to invoke the reports:

Public Sub PreviewInvoice()

Dim ac As New Access.Application

ac.OpenCurrentDatabase(oApp.DatabaseFileName)

ac.DoCmd.OpenReport("03Invoice", Access.AcView.acViewPreview,
"qry03InvoiceQuery", "[BillingEntityID]=" & Me.ID)

ac.Visible = True
ac.DoCmd.Maximize()

ac = Nothing

End Sub

Can anybody provide me with a clue here?

TIA




Nov 20 '05 #4
On 11 Jan 2004 02:29:21 +0100, hi***************@gmx.at (Herfried K.
Wagner [MVP]) wrote:
* do****@dougalfair.com (Dougal Fair) scripsit:
I have written a vb.net program that invokes an Access2000 report in
Preview mode, so that it shows on the screen. My program then goes on
its merry way and the user can read the report and close it at his
leisure.

My problem is: when I run this on Win2000 and watch it with the Task
Manager, I see it create a task for MSACCESS.EXE for the report. But
when the user closes the report, the task does not always disappear
from the Task Manager (sometimes it does).


<http://support.microsoft.com/default.aspx?scid=kb;en-us;317109>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Thanks very much - that was exactly what I needed.
Usenet is such a wonderful thing. Cheers to the MVP's !

Nov 20 '05 #5
FWIW, you don't need the ac=nothing statement.

-- Mary
MCW Technologies
http://www.mcwtech.com

On Sun, 11 Jan 2004 06:54:54 GMT, do****@dougalfair.com (Dougal Fair)
wrote:
On Sat, 10 Jan 2004 19:53:03 -0500, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Add this after ac= nothing .
System.Runtime.InteropServices.Marshal.ReleaseCo mObject(ac)

Ken


Thank you very much - that did the trick. Except that when I added
that line *after* the ac=nothing it complained about ac not being set
to any object. So I moved the line to just *before* the ac=nothing
statement and then it appears to work fine.

Again, thanks much - it was not at ALL obvious to me how to do that.

-----------------
"Dougal Fair" <do****@dougalfair.com> wrote in message
news:40****************@news.goldengate.net...
Hello,

I have written a vb.net program that invokes an Access2000 report in
Preview mode, so that it shows on the screen. My program then goes on
its merry way and the user can read the report and close it at his
leisure.

My problem is: when I run this on Win2000 and watch it with the Task
Manager, I see it create a task for MSACCESS.EXE for the report. But
when the user closes the report, the task does not always disappear
from the Task Manager (sometimes it does).

When it hangs around, then I can't double-click on an Acess2000 MDB
database file in Windows Explorer so as to open the database.
Apparently the existing instance of the MSACCESS.EXE task gets in the
way.

If I close the dialog from which I launched the Acess2000 report,
sometimes that causes the MSACCESS.EXE task to go away, but frequently
it does not. If I close the VB program itself, that usually kills the
MSACCESS.EXE taks, but not always. Sometimes, if I repetedly invoke
reports from my program (for different customer records), I can get
multiple MSACCESS.EXE tasks going, and even though I close the
Access2000 report windows and exit the VB program, the MSACCESS.EXE
tasks remain, and the only way I can get rid of them is to kill them
from within the Task Manager.
I thought this was because of how .NET doesn't actually release memory
even though you have closed and disposed of the objects that used the
resources, but how do I force the resources to be released?
Here is the code I use to invoke the reports:

Public Sub PreviewInvoice()

Dim ac As New Access.Application

ac.OpenCurrentDatabase(oApp.DatabaseFileName)

ac.DoCmd.OpenReport("03Invoice", Access.AcView.acViewPreview,
"qry03InvoiceQuery", "[BillingEntityID]=" & Me.ID)

ac.Visible = True
ac.DoCmd.Maximize()

ac = Nothing

End Sub

Can anybody provide me with a clue here?

TIA




Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item)...
9
by: DW | last post by:
Greetings: I have a SQL 2000 server with several databases on it, and I have a maintenance plan that includes both a backup and a CHECKDB Integrity Check. The backups appear to run correctly...
1
by: ward | last post by:
Good morning everyone. I'm building a very simple content management site that tracks "tasks." The options available are: 1. Add Task 2. Edit Task 3. View Task 4. Print Task
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
0
by: TDC | last post by:
Hello, I am writing an application (VB Visual Studio 2005) which connects to an Access database with several simple Tables. When the user invokes a Dialogue box a table is populated with data...
3
by: kj7ny | last post by:
How can I access and manipulate Scheduled Tasks in Windows using Python? I have a Windows XP workstation running Python 2.4.4 using the win32all modules to control the windows services on...
9
by: nickvans | last post by:
Hello everyone, I'm trying to create an MS Access 03 database to be used in optimizing flow for various tasks. The idea is I have a table with task names, duration of each task, and the name of a...
1
by: mattia | last post by:
Hello guys, here I am once again asking questions: 1) This is a totally random question: is there in this website a section for Access beginners? A section clearly explaining basic stuff? 2)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.