Stuart McLachlan
stuart at lexacorp.com.pg
Fri Jan 27 17:25:43 CST 2012
I think you misunderstood me. I was not suggesting a Windows Scheduled Task to shut
down, I was talking about using the internal table driven tasks to quit the application, but
before doing so, create a Windows Task to re-start the application after an appropriate time
has been elapsed.
Something like:
Sub Shutdown(QuietTime as long)
strTask = currentproject.name
...
If QuietTime > 0 Then
dtStart = Now() + quiettime
strRestart = " /D " & Format$(dtStart,"mm/dd/yyyy") & _
" /T " & Format$(dtStart,"hh:mm")
strSched = "SCHTASK /CREATE " & ... & strTask & strReStart
SHELL(strSched)
End If
Application.Quit
End Sub
--
Stuart
On 27 Jan 2012 at 22:59, Benson, William (GE Global Re wrote:
> >> shut itself down at a specified time
>
> Assuming the database is not otherwise occupied? Or do you trust a
> Windows Scheduler and a programmer's forethought to know whether it is
> cool to kill a database which has been running manually or via
> automagic?
>
> I would lean towards your tables route if you want the application to
> be self-aware and only quit when *it* thinks it is ok to quit, John.
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
> Sent: Friday, January 27, 2012 5:22 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] How to shut down Access
>
> If it's a fully automated application, with a scheduler built in, it should be trivial to add the
> ability to shut itself down at a specified time. It's also not that difficult to create a "one-off"
> scheduled task at the same time to restart the application x minutes later.
>
> --
> Stuart
>
> On 27 Jan 2012 at 11:56, jwcolby wrote:
>
> > I hear ya. However this is an app which runs reports, does imports
> > etc. The things it does is scheduled by records in a table. I guess
> > I could just put something in that table that shuts it down at a specific time.
> >
> > John W. Colby
> > Colby Consulting
> >
> --
> Stuart McLachlan
>
> Ph: +675 340 4392
> Mob: +675 7100 2028
> Web: http://www.lexacorp.com.pg
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
Stuart McLachlan
Ph: +675 340 4392
Mob: +675 7100 2028
Web: http://www.lexacorp.com.pg