PC Review


Reply
Thread Tools Rate Thread

Compact command line failure

 
 
=?Utf-8?B?UGhpbCBEYXZ5?=
Guest
Posts: n/a
 
      1st Mar 2006
I have got a scheduled task set up designed to compact and repair my database.

In the Run box I have entered the following text:

K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
/compact

I took the syntax directly from Access help.

However when the task runs all it does is open the database without actually
compacting it.

Could anyone please help?!

Thanks in advance.
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      1st Mar 2006
"Phil Davy" <(E-Mail Removed)> wrote in message
news:7236BF15-FECC-4630-BE1C-(E-Mail Removed)
> I have got a scheduled task set up designed to compact and repair my
> database.
>
> In the Run box I have entered the following text:
>
>

K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.md
b
> /compact
>
> I took the syntax directly from Access help.
>
> However when the task runs all it does is open the database without
> actually compacting it.
>
> Could anyone please help?!
>
> Thanks in advance.


I believe you have to explicitly execute the msaccess.exe program, and
provide both the database path and the /compact argument on the command
line. E.g.,

msaccess.exe
K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.md
b /compact

(all on one line in the Run box).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      1st Mar 2006
/compact is actually a command-line switch for msaccess.exe, so you need to
include that in your command line as well.

The actual command you need will depend on what version of Access you're
running (or, more accurately, where msaccess.exe is installed on your
machine), but it will take the form of:

"C:\Program Files\Microsoft Office.11\OFFICE11\msaccess.exe"
K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
/compact

(all on one line, of course)

Note that you need quotes around the full path to the executable, since
there are spaces in the path name.

Also, you may want to take advantage of the fact that you can compact to a
different file. I'd create a batch file that renames the existing file and
compacts the renamed file to the "proper" file name. If something goes wrong
during the compact, you could end up hosing your database.

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


"Phil Davy" <(E-Mail Removed)> wrote in message
news:7236BF15-FECC-4630-BE1C-(E-Mail Removed)...
>I have got a scheduled task set up designed to compact and repair my
>database.
>
> In the Run box I have entered the following text:
>
> K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
> /compact
>
> I took the syntax directly from Access help.
>
> However when the task runs all it does is open the database without
> actually
> compacting it.
>
> Could anyone please help?!
>
> Thanks in advance.



 
Reply With Quote
 
=?Utf-8?B?UGhpbCBEYXZ5?=
Guest
Posts: n/a
 
      1st Mar 2006
By the way, the d/b does need compacting, it is not already compacted!

"Phil Davy" wrote:

> I have got a scheduled task set up designed to compact and repair my database.
>
> In the Run box I have entered the following text:
>
> K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
> /compact
>
> I took the syntax directly from Access help.
>
> However when the task runs all it does is open the database without actually
> compacting it.
>
> Could anyone please help?!
>
> Thanks in advance.

 
Reply With Quote
 
=?Utf-8?B?UGhpbCBEYXZ5?=
Guest
Posts: n/a
 
      1st Mar 2006
Awesome!

Thanks chaps it now works having put "C:\Program Files\Microsoft
Office\Office10.msaccess.exe" in front.

And the task icon has turned into the Access icon

Of course how would it have known previously?!

Many thanks for this!

Phil





"Douglas J. Steele" wrote:

> /compact is actually a command-line switch for msaccess.exe, so you need to
> include that in your command line as well.
>
> The actual command you need will depend on what version of Access you're
> running (or, more accurately, where msaccess.exe is installed on your
> machine), but it will take the form of:
>
> "C:\Program Files\Microsoft Office.11\OFFICE11\msaccess.exe"
> K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
> /compact
>
> (all on one line, of course)
>
> Note that you need quotes around the full path to the executable, since
> there are spaces in the path name.
>
> Also, you may want to take advantage of the fact that you can compact to a
> different file. I'd create a batch file that renames the existing file and
> compacts the renamed file to the "proper" file name. If something goes wrong
> during the compact, you could end up hosing your database.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Phil Davy" <(E-Mail Removed)> wrote in message
> news:7236BF15-FECC-4630-BE1C-(E-Mail Removed)...
> >I have got a scheduled task set up designed to compact and repair my
> >database.
> >
> > In the Run box I have entered the following text:
> >
> > K:\User\Aggregates\Live\Deductibles\NF_Catlin_Exposure_Management_1.2.mdb
> > /compact
> >
> > I took the syntax directly from Access help.
> >
> > However when the task runs all it does is open the database without
> > actually
> > compacting it.
> >
> > Could anyone please help?!
> >
> > Thanks in advance.

>
>
>

 
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
Command Line way to Compact pst file? =?Utf-8?B?YmJfYWVz?= Microsoft Outlook Discussion 6 21st Jan 2007 08:30 PM
Q: Outlook 2003 -- Possible to compact PST's from command line? x9012590125@hotmail.com Microsoft Outlook Discussion 1 8th Aug 2005 12:59 AM
URGENT plz help - compact db w/ pass from command line John Smith Microsoft Access 2 2nd Jun 2004 10:43 AM
Compact & Repair cmd from command line? =?Utf-8?B?QnJhZCBSaWNrYXJk?= Microsoft Access Forms 3 20th Feb 2004 06:18 PM
Outlook 2002 -- command-line compact? Anthony Steve Microsoft Outlook 5 2nd Aug 2003 04:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:03 AM.