D
Dougal Fair
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
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