PC Review


Reply
Thread Tools Rate Thread

Close Database Function?

 
 
PcolaITGuy
Guest
Posts: n/a
 
      9th Jan 2008
I want to use task scheduler to open an Access DB, run a macro that updates a
table from an external source, then close the DB and Access. I do not use
any forms on this database, just one table and one macro.

So I guess my needs are as follows:
1. Automatically execute 'My_Macro' when the DB is opened from Task
Scheduler. My Scheduled Task uses the /X switch to specify and execute the
Macro - my main problem is determining how to programatically close the DB
and Access. I would like to continue using the command line method of
executing the macro if possible so that I can manually open the database
easily to do administrative tasks.

2. Once all macro operations are completed, automatically close the DB and
the Access program.

Your suggestions are greatly appreciated!!!!

Scott
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      10th Jan 2008
On Wed, 9 Jan 2008 15:44:35 -0800, PcolaITGuy
<(E-Mail Removed)> wrote:

>2. Once all macro operations are completed, automatically close the DB and
>the Access program.
>


Just put

Quit

in the action of the last step of the macro.

John W. Vinson [MVP]
 
Reply With Quote
 
Bob Quintal
Guest
Posts: n/a
 
      10th Jan 2008
=?Utf-8?B?UGNvbGFJVEd1eQ==?= <(E-Mail Removed)>
wrote in news:8367D4D8-B3BE-40B9-A12D-(E-Mail Removed):

> I want to use task scheduler to open an Access DB, run a macro
> that updates a table from an external source, then close the DB
> and Access. I do not use any forms on this database, just one
> table and one macro.
>
> So I guess my needs are as follows:
> 1. Automatically execute 'My_Macro' when the DB is opened from
> Task Scheduler. My Scheduled Task uses the /X switch to specify
> and execute the Macro - my main problem is determining how to
> programatically close the DB and Access. I would like to continue
> using the command line method of executing the macro if possible
> so that I can manually open the database easily to do
> administrative tasks.
>
> 2. Once all macro operations are completed, automatically close
> the DB and the Access program.
>
> Your suggestions are greatly appreciated!!!!
>
> Scott
>

Create a new macro, that has 2 steps: the first is RunMacro with
your existing macro as the macro to run, and the second step
executes the Quit action. Save your macro as My_Macro_CloseDb.

Change the /x parameter to the name of the new macro

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

 
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
Importing Excel data to database causing Database to Close. Hotwheelsrc51 Microsoft Access External Data 1 17th Jun 2008 04:48 PM
access opens database first time, close and retry database won't o =?Utf-8?B?Y29tcHVzZXIxMA==?= Microsoft Access 2 30th Jan 2007 04:19 PM
Close the Switchboard, Close the Database =?Utf-8?B?QXByaWwgS2xlaW4=?= Microsoft Access Forms 2 25th Aug 2006 08:22 PM
Database question - Database Open, Close Design =?Utf-8?B?TWFjY2E=?= Microsoft C# .NET 4 20th Sep 2005 10:01 PM
Close database on close form Kevin Sprinkel Microsoft Access Forms 5 7th Apr 2004 06:49 PM


Features
 

Advertising
 

Newsgroups
 


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