Solved

compacting a ms-access 2010 database

Posted on 2014-04-25
2
368 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 49

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

773 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