Access 2000 will not close programmatically

R

Rob Hughes

I am writing an external app that utilizes. The app needs to be able to run
repeatedly, but I am having a problem because Access will not close. When
..Quit is called, it pops up a blank Access window, which will not close by
normal means, only by ending the process in Task Manager.

Here is the applicable Access code, in VB.NET:

Dim appAcc As New Access.Application
appAcc.Visible = False
appAcc.OpenCurrentDatabase(dbname, True)
appAcc.DoCmd.DeleteObject(acTable, "ArcSumm")
appAcc.DoCmd.DeleteObject(acTable, "zip_table")
appAcc.DoCmd.DeleteObject(acTable, "ArcCover")
appAcc.DoCmd.TransferDatabase(acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcSumm", "ArcSumm")
appAcc.DoCmd.TransferDatabase(acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcCover", "ArcCover")
appAcc.DoCmd.TransferDatabase(acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcZips", "zip_table")
appAcc.DoCmd.RunMacro("webCover")
Dim summ As DAO.Recordset
summ = appAcc.CurrentDb.OpenRecordset("ArcSumm")
If summ.RecordCount = 0 Then
appAcc.DoCmd.RunMacro("DoEverythingWebNoHaz")
Else
appAcc.DoCmd.RunMacro("DoEverythingWeb")
End If
summ.Close()
summ = Nothing
appAcc.DoCmd.OpenReport("Definitions", Access.AcView.acViewNormal) 'dummy
report to flush the pdf file
appAcc.DoCmd.Close(acReport, "Definitions", Access.AcCloseSave.acSaveNo)
appAcc.CloseCurrentDatabase()
appAcc.Quit(Access.AcQuitOption.acQuitSaveNone)
appAcc = Nothing

I have tried to ensure that everything is closed out, and yet it persist in
popping up the Access window. If I try to run the app again, it fails
because it cannot access the database.

Can anyone advise me what to do?
 
D

Douglas J. Steele

I think you'd probably be better off asking in a Dot Net-related group, such
as microsoft.public.dotnet.languages.vb.data

This doesn't look like an Access issue to me.
 
G

Guest

Hi,
I have written an application Access 97. I face the same problem as Rob.
Sometimes when I click the close box, my application is closed alright, but
Access remained open as a blank window. My application is written using VBA
and DOA 3.6.
Hope someone can help.
 

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

Similar Threads


Top