Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Compact and Repair elsewhere

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stapes - 19 Dec 2007 16:21 GMT
Hi

I have a button for Compact and Repair database. This is the code
behind it:

CommandBars("Menu Bar"). _
  Controls("Tools"). _
  Controls("Database utilities"). _
  Controls("Compact and repair database..."). _
  accDoDefaultAction

Unfortunately, this only operates on the front end, but where it
really needs it is on the backend. Can I use this code to make it
compact and repair another database file?

Stapes
Roger Carlson - 19 Dec 2007 16:35 GMT
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "CompactBackEndDB.mdb" which illustrates how to do this.

Signature

--Roger Carlson
 MS Access MVP
 Access Database Samples: www.rogersaccesslibrary.com
 Want answers to your Access questions in your Email?
 Free subscription:
 http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

> Hi
>
[quoted text clipped - 12 lines]
>
> Stapes
Stapes - 19 Dec 2007 17:37 GMT
On Dec 19, 4:35 pm, "Roger Carlson" <RogerCarl...@noemail.noemail>
wrote:
> On my website (www.rogersaccesslibrary.com), is a small Access database
> sample called "CompactBackEndDB.mdb" which illustrates how to do this.
[quoted text clipped - 25 lines]
>
> - Show quoted text -

Hi

I have borrowed code from your database. However, whenever I try to
run the Compact, I get an error:

3356 You attempted to open a database that is already opened
exclusively by user 'Admin' on machine 'CIOS05'. Try again when the
database is available.

It works OK in your database. What am I doing wrong?

Stapes
Roger Carlson - 19 Dec 2007 17:46 GMT
You will get the same error in my sample if you open the linked table and
leave it open while you compact it.  You can't have any of the tables open
or any forms or queries open that are based on any tables in the back end
database.

Signature

--Roger Carlson
 MS Access MVP
 Access Database Samples: www.rogersaccesslibrary.com
 Want answers to your Access questions in your Email?
 Free subscription:
 http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

> On Dec 19, 4:35 pm, "Roger Carlson" <RogerCarl...@noemail.noemail>
> wrote:
[quoted text clipped - 40 lines]
>
> Stapes
Stapes - 20 Dec 2007 09:32 GMT
On Dec 19, 5:46 pm, "Roger Carlson" <RogerCarl...@noemail.noemail>
wrote:
> You will get the same error in my sample if you open the linked table and
> leave it open while you compact it.  You can't have any of the tables open
[quoted text clipped - 59 lines]
>
> - Show quoted text -

Is there any way I can query which forms are open and then close them?
I think this is my problem. And will the code still execute even if
the form which has called it been closed?
Ideally, I would want it to re-open again and report that the Compact
and Repair was successful.

Stapes
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.