(This is a crosspost from .data for greater exposure)
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. Oddly enough, the
first time that this is run after a reboot, it works fine, but every time
after that, it will not close.
Here is the applicable Access code, in VB.NET:
Dim appAcc As New Access.Applicat ion
appAcc.Visible = False
appAcc.OpenCurr entDatabase(dbn ame, True)
appAcc.DoCmd.De leteObject(acTa ble, "ArcSumm")
appAcc.DoCmd.De leteObject(acTa ble, "zip_table" )
appAcc.DoCmd.De leteObject(acTa ble, "ArcCover")
appAcc.DoCmd.Tr ansferDatabase( acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcSumm", "ArcSumm")
appAcc.DoCmd.Tr ansferDatabase( acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcCover", "ArcCover")
appAcc.DoCmd.Tr ansferDatabase( acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcZips", "zip_table" )
appAcc.DoCmd.Ru nMacro("webCove r")
Dim summ As DAO.Recordset
summ = appAcc.CurrentD b.OpenRecordset ("ArcSumm")
If summ.RecordCoun t = 0 Then
appAcc.DoCmd.Ru nMacro("DoEvery thingWebNoHaz")
Else
appAcc.DoCmd.Ru nMacro("DoEvery thingWeb")
End If
summ.Close()
summ = Nothing
appAcc.DoCmd.Op enReport("Defin itions", Access.AcView.a cViewNormal) 'dummy
report to flush the pdf file
appAcc.DoCmd.Cl ose(acReport, "Definition s", Access.AcCloseS ave.acSaveNo)
appAcc.CloseCur rentDatabase()
appAcc.Quit(Acc ess.AcQuitOptio n.acQuitSaveNon e)
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?
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. Oddly enough, the
first time that this is run after a reboot, it works fine, but every time
after that, it will not close.
Here is the applicable Access code, in VB.NET:
Dim appAcc As New Access.Applicat ion
appAcc.Visible = False
appAcc.OpenCurr entDatabase(dbn ame, True)
appAcc.DoCmd.De leteObject(acTa ble, "ArcSumm")
appAcc.DoCmd.De leteObject(acTa ble, "zip_table" )
appAcc.DoCmd.De leteObject(acTa ble, "ArcCover")
appAcc.DoCmd.Tr ansferDatabase( acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcSumm", "ArcSumm")
appAcc.DoCmd.Tr ansferDatabase( acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcCover", "ArcCover")
appAcc.DoCmd.Tr ansferDatabase( acImport, "dBase 5.0", dbloc + pnum, acTable,
"ArcZips", "zip_table" )
appAcc.DoCmd.Ru nMacro("webCove r")
Dim summ As DAO.Recordset
summ = appAcc.CurrentD b.OpenRecordset ("ArcSumm")
If summ.RecordCoun t = 0 Then
appAcc.DoCmd.Ru nMacro("DoEvery thingWebNoHaz")
Else
appAcc.DoCmd.Ru nMacro("DoEvery thingWeb")
End If
summ.Close()
summ = Nothing
appAcc.DoCmd.Op enReport("Defin itions", Access.AcView.a cViewNormal) 'dummy
report to flush the pdf file
appAcc.DoCmd.Cl ose(acReport, "Definition s", Access.AcCloseS ave.acSaveNo)
appAcc.CloseCur rentDatabase()
appAcc.Quit(Acc ess.AcQuitOptio n.acQuitSaveNon e)
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?
Comment