473,386 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Compact and repair Back End From Front End at Runtime

Hi Everybody

For Microsoft Access 2000 and above
Windows XP

I am trying to mimic the action of this command that at the moment runs
from the start>>all programs at the bottom left of the screen.

"C:\Program Files\Microsoft Office\ART\Office\MSACCESS.EXE" _
/excl /runtime /profile "MYDB" /wrkgrp _
"C:\Program Files\Stortvalley\MYDB2\system.mdw" _
/repair "C:\Program Files\Stortvalley\MYDB2\MYDB2_Be.mdb" /compact

The idea is to be able to compact and repair the Backend database from
a command button on the Front End mde on a machine that has not got
full version Microsoft Access on it.....just the ART (Access Run Time)

Thanks for any help

Bob

May 12 '06 #1
2 4964
Use the CompactDatabase method of the DBEngine.

What I typically do is rename the existing backend, putting in today's date
and changing the extension to .bak. I then compact that to the "correct"
database. That way, I have a backup as well.

Dim strCurrentBackend As String
Dim strRenamedBackend As String

strCurrentBackend = .....
strRenamedBackend = Left$(strCurrentBackend, Len(strCurrentBackend) - 4)
& _
Format$(Date(), "yyyymmdd") & ".bak"

Name strCurrentBackend As strRenamedBackend

DBEngine.CompactDatabase strRenamedBackend, strCurrentBackend
I've left out how to determine where the current backend is, but it's pretty
straightforward. One way is to check the Connect roperty of a linked table,
and strip off the ";DATABASE=" from the front of it:

strCurrentBackend = Mid$(CurrentDb().TableDefs("MyLinkedTable").Connec t,
11)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"bobdydd" <re**************@yahoo.co.uk> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
Hi Everybody

For Microsoft Access 2000 and above
Windows XP

I am trying to mimic the action of this command that at the moment runs
from the start>>all programs at the bottom left of the screen.

"C:\Program Files\Microsoft Office\ART\Office\MSACCESS.EXE" _
/excl /runtime /profile "MYDB" /wrkgrp _
"C:\Program Files\Stortvalley\MYDB2\system.mdw" _
/repair "C:\Program Files\Stortvalley\MYDB2\MYDB2_Be.mdb" /compact

The idea is to be able to compact and repair the Backend database from
a command button on the Front End mde on a machine that has not got
full version Microsoft Access on it.....just the ART (Access Run Time)

Thanks for any help

Bob

May 12 '06 #2
Hi Doug

As always you get me out of trouble ...................Thanks
I have not tried it on a machine without Full version Access installed
(just the ART) but I reckon it will work.
I altered it slightly to put the Backups it a different directory

Once again Thanks a lot

Bob

May 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: krisa | last post by:
Would appreciate any help on this: I have an A2K frontend/backend application developed & tested on client's "usual" server. Then moved both back and front ends to a different server so...
1
by: ColinWard | last post by:
I don'tunderstand why when you use Compact and Repair, only the front end is compacted? I understand about repairing, because the front end stores the forms, queries etc. but the backend is where...
4
by: Wayne | last post by:
Does "Compact On Close" do a "Compact and Repair" or just a compact. Is a compact necessary (or at least a good idea) on a regular basis, say weekly, for a database that has several hundred records...
5
by: Lauren Wilson | last post by:
Hi folks, Somewhere, I recently saw an article header titled: "How to compact and Repair a back-end Access db from the front-end using VBA" or words to that effect. Now that I need it, I...
6
by: GaryDave | last post by:
My school registration database has not been quite right after a recent compact and repair (done while I was away). Though most of the many forms and subforms are working normally, one form in...
3
by: G Gerard | last post by:
Hello The more I use an application ( an mdb) created using MSAccess I notice that the Byte size of the application keeps on increasing. Once in a while I do a Compact and Repair Database...
2
by: Ron | last post by:
Hi All, Using WinXP pro/Access 2000. I have a database that's been used for about 5 months. Transferred lots of data from a dos based program, then the users have been using it for that 5...
9
by: Ron | last post by:
New discovery. If I take a perfectly good database, and "compact/repair" on it with Access 2000 (seems to be at multiple sites--I've tried it with my system here, at another office on an...
5
by: teddysnips | last post by:
My client has asked if it's possible to Compact and Repair his Front End database programmatically. I remember doing this from a VB application about 10 years ago, so I wondered if it was possible...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.