473,387 Members | 1,504 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,387 software developers and data experts.

Compact Repair Database

46
HI All

Currently i have a access database and i am currently doing compact and repair using the tool in database.Can any one help me by giving me the code for doing the same thing so that i can call that method in a button click so that users can do it their own.Thanks in advance
Mar 7 '08 #1
5 2183
depends on the version of access. see http://www.thescripts.com/forum/thread568193.html , looks a bit trickier with ms access 97

If you are using 2000+ maybe try

add a new module
add function (must be only code in module):

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

End Function

call the function from your buttons Click event
I have tried on msaccess 2002/2003 and works OK.

good luck ramdil :)
Mar 7 '08 #2
missinglinq
3,532 Expert 2GB
Important to remember is that compacting a database is a common cause of corruption! It should never, ever be done until the db has first been backed up!

Linq ;0)>
Mar 7 '08 #3
excellent point missinglinq, and thank you for a great mousemove tutorial :)
Mar 7 '08 #4
missinglinq
3,532 Expert 2GB
You're welcome, Blad3! The How To section is always a great place to browse thru when you have a few minutes! Lots of great stuff in their, all of it generated because it addresses things that have been asked beacoup times.

Linq ;0)>
Mar 7 '08 #5
ramdil
46
Thanks for the replies.I will try and get back to you .Any thanks for all responses.


depends on the version of access. see http://www.thescripts.com/forum/thread568193.html , looks a bit trickier with ms access 97

If you are using 2000+ maybe try

add a new module
add function (must be only code in module):

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

End Function

call the function from your buttons Click event
I have tried on msaccess 2002/2003 and works OK.

good luck ramdil :)
Mar 10 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: KEVIN97810 | last post by:
Hello to all, Assume my mdb name is Cust.MDB. I want to compact & repair the same Cust.MDB when the user exit the program. Is there a way you can do it in code behind the EXIT button. I am...
3
by: Paolo | last post by:
Hi, I am trying to compact and repair my database, however every time I try it comes up a message saying: Table: "TempMSysAccessObject already exists", whenever I try to look for this table I...
4
by: Ken Winters | last post by:
Whenever I run the Repair/Compact on my database, the security settings on the file change. A 3rd party application can only access the database over the network when the username "Everyone" is...
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...
8
by: Jeff | last post by:
I have a db that has a couple of times closed Access completely when Saving work. So I usually compact and decompile and this seems to fix the problem. But not his time. It has come back again....
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...
3
by: Bizmark | last post by:
Access2003, Windows XP Pro OEM user OS, Windows Sever 2000 server OS. Not-so-recently I inherited 3 Access DB's from another company merging with our own. Our own system works off of SQL...
4
by: zufie | last post by:
When I Repair/Compact my Access databse. I get icons/copies of a database named db1.mdb, db2.mdb, db3.mdb, etc... How else may I repair this database? Thanks!, Zuf
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.