Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 6th, 2007, 04:56 PM
Registered User
 
Join Date: Nov 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compact and Repair Access Database

Hai !
How can i compact an repair a password protected Access data base file using vb 6.0. i use access 2000 version
Thanks in advance

 
Old November 6th, 2007, 05:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there.. I don't remember the exact code, but ADOengine has a compact (that also repair) function...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old November 6th, 2007, 09:07 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

The following link might help you

http://vbadud.blogspot.com/2007/09/r...ft-access.html

Cheers
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old May 21st, 2013, 05:41 PM
Registered User
 
Join Date: May 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access 2007 compact and repair thru VBA

Hello,

Does anyone know how to compact a db in Access 2007 using VBA code? I will be happy to compact it on closing the application, since the database would have to be closed during the compact process.

Thank you all in advance!
 
Old May 22nd, 2013, 03:46 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

You can try this one

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
__________________
(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is  how you got it
 
Old May 22nd, 2013, 03:47 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Do you want it to be done using Access Vba or from Excel or Word

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old May 22nd, 2013, 10:33 AM
Registered User
 
Join Date: May 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compact db in Access 2007

Shaur,

I am trying to do it from Access 2007 via VBA.

Thank you,
Bella
 
Old May 22nd, 2013, 10:35 AM
Registered User
 
Join Date: May 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Numan,

Thank you for your reply, nope, the code does not want to work..:(

Bella
 
Old May 23rd, 2013, 10:00 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Quote:
Originally Posted by bzboex View Post
Hi Numan,

Thank you for your reply, nope, the code does not want to work..:(

Bella
In case of VBA

http://stackoverflow.com/questions/1...atabase-in-vba

might be helpful for you.

Best of luck :)
__________________
(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is  how you got it





Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Compact and Repair Corey Access VBA 4 March 29th, 2006 10:49 AM
is there any auto compact repair utility to buy ? surajguru Access 5 October 15th, 2005 02:45 PM
Compact/Repair Access Database On The Fly kevorkian Classic ASP Databases 3 November 22nd, 2004 06:57 PM
Compact And Repair Access Database myedu2k4 Pro VB Databases 1 May 25th, 2004 01:43 AM
Compact Access Database lai_ccca Access VBA 0 January 9th, 2004 08:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.