473,804 Members | 3,094 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Offi ce\MSACCESS.EXE " _
/excl /runtime /profile "MYDB" /wrkgrp _
"C:\Program Files\Stortvall ey\MYDB2\system .mdw" _
/repair "C:\Program Files\Stortvall ey\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 5008
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 strCurrentBacke nd As String
Dim strRenamedBacke nd As String

strCurrentBacke nd = .....
strRenamedBacke nd = Left$(strCurren tBackend, Len(strCurrentB ackend) - 4)
& _
Format$(Date(), "yyyymmdd") & ".bak"

Name strCurrentBacke nd As strRenamedBacke nd

DBEngine.Compac tDatabase strRenamedBacke nd, strCurrentBacke nd
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:

strCurrentBacke nd = Mid$(CurrentDb( ).TableDefs("My LinkedTable").C onnect,
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******** *************@i 39g2000cwa.goog legroups.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\Offi ce\MSACCESS.EXE " _
/excl /runtime /profile "MYDB" /wrkgrp _
"C:\Program Files\Stortvall ey\MYDB2\system .mdw" _
/repair "C:\Program Files\Stortvall ey\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
1280
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 application could be used by folks in another department. Weird behavior: When we put the back-end on the different server, then we can't do a compact/repair on the front end, no matter where the front end is (C drive of a PC, new server or old...
1
1498
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 the data is stored and surely that file will need to be compacted more than the front end? Colin
4
2085
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 per week added to it? TIA.
5
17666
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 cannot find it. Does anyone know were to find such an article?
6
3085
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 particular will no longer allow new entries into the subform - the recordset of the underlying query is no longer updatable. The subform in question enters the identity and other vital info for children whose parent's ID provides the FK, linking...
3
2184
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 (under Tools in MSAccess) on the application and the size then returns to normal.
2
2783
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 months. About 180000 records in one of the main files (maybe 25000 new since the dos conversion). Been having some speed issues crop up along the way (much faster to do same reports when I first transferred the data than now, with the new 25000...
9
3993
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 entirely different network), it damages the file somehow. The user's machine that did the compact/repair can see the file fine. But any networked user can't get in. I can double click on a good database file from any user (over the network) and it...
5
2227
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 in Access. The application is Access 2003 in 2002-2003 File Format. I've added the following function to the Front End in a global module: Public Function CandRDB()
0
9569
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.