PC Review


Reply
Thread Tools Rate Thread

Access 2000 will not close programmatically

 
 
Rob Hughes
Guest
Posts: n/a
 
      17th Jun 2005
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?


 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      17th Jun 2005
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.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Rob Hughes" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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?
>
>



 
Reply With Quote
 
Mario Madani
Guest
Posts: n/a
 
      27th Jun 2005
Docmd.application Quit




"Rob Hughes" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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?
>
>



 
Reply With Quote
 
=?Utf-8?B?Sm9obiBLb25n?=
Guest
Posts: n/a
 
      19th Aug 2005
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.
--
JK


"Rob Hughes" wrote:

> 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?
>
>
>

 
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
Access 2000: Selecting records programmatically Mike Mertes Microsoft Access Form Coding 2 4th Nov 2004 05:07 PM
Programmatically Importing References in Access 2000 Michelle Microsoft Access External Data 4 1st Dec 2003 08:50 PM
How to programmatically close an Access Database Dom Microsoft Access VBA Modules 2 23rd Oct 2003 09:27 PM
Re: Programmatically convert Access 2000 to Access 97 - Can it be done? Ron Hinds Microsoft Access VBA Modules 0 31st Jul 2003 07:00 PM
Re: Programmatically convert Access 2000 to Access 97 - Can it be done? Ron Hinds Microsoft Access VBA Modules 0 31st Jul 2003 06:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:14 PM.