Connecting Tech Pros Worldwide Help | Site Map

Compacting a database on close

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 02:33 PM
ColinWard
Guest
 
Posts: n/a
Default Compacting a database on close

Is there a way to compact the current database when the user clicks the
exit button. Alternatively, what is the command line switch to compact
the database when the user opens the database?

Thank you

Colin Ward




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

  #2  
Old November 12th, 2005, 02:34 PM
Wayne Morgan
Guest
 
Posts: n/a
Default Re: Compacting a database on close

If you have Access 2000 or newer, one of the options in Tools|Options is Compact on Close.


/compact target database or target Access project

Compacts and repairs the Access database, or compacts the Access project that was
specified before the /compact option, and then closes Access. If you omit a target file
name following the /compact option, the file is compacted to the original name and folder.
To compact to a different name, specify a target file. If you don't include a path in
target database or target Access project, the target file is created in your My Documents
folder by default.
In an Access project, this option compacts the Access project (.adp) file but not the
Microsoft SQL Server database.

This is from the help file. You may also want to include /excl to make sure you open it in
exclucive mode.

For the switches to work, you can't just specify the database in the command line, you
have to start with the command for Access.

"<path>\msaccess.exe" "<path>\MyDatabase.mdb" /excl /compact "<path>\compacted.mdb"


--
Wayne Morgan


"ColinWard" <jetfighter3@hotmail.com> wrote in message
news:3f95459c$0$194$75868355@news.frii.net...[color=blue]
> Is there a way to compact the current database when the user clicks the
> exit button. Alternatively, what is the command line switch to compact
> the database when the user opens the database?
>
> Thank you
>
> Colin Ward
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.