Solved

compacting a ms-access 2010 database

Posted on 2014-04-25
2
373 Views
Last Modified: 2014-05-05
How do I compact an ms-access 2010 database in code. I am using vb.net

Anthony
0
Comment
Question by:Anthony Matovu
2 Comments
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 250 total points
ID: 40022179
Hi,

pls try

' oAccess is the Access Application
oAccess.DoCmd.CloseDatabase acCmdCompactDatabase

Open in new window

Regards
0
 
LVL 20

Accepted Solution

by:
hes earned 250 total points
ID: 40022690
Have a look here
http://support.microsoft.com/kb/306287

See link for required references...

Sub Main()

        Dim jro As JRO.JetEngine

        jro = New JRO.JetEngine()

        jro.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\nwind.mdb", _
        "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NewNwind.mdb;Jet OLEDB:Engine Type=5")

        MsgBox("Finished Compacting Database!")
    End Sub
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question