p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB How-To (http://p2p.wrox.com/forumdisplay.php?f=78)
-   -   Compact and Repair Access Database (http://p2p.wrox.com/showthread.php?t=63566)

raguapk November 6th, 2007 04:56 PM

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


gbianchi November 6th, 2007 05:41 PM

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
================================================== =========

Shasur November 6th, 2007 09:07 PM

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)

bzboex May 21st, 2013 05:41 PM

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!

qazi_nomi May 22nd, 2013 03:46 AM

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

Shasur May 22nd, 2013 03:47 AM

Hi

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

Cheers
Shasur

bzboex May 22nd, 2013 10:33 AM

Compact db in Access 2007
 
Shaur,

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

Thank you,
Bella

bzboex May 22nd, 2013 10:35 AM

Hi Numan,

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

Bella

qazi_nomi May 23rd, 2013 10:00 AM

Quote:

Originally Posted by bzboex (Post 291516)
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 :)


All times are GMT -4. The time now is 05:24 PM.

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