Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 6th, 2007, 04:56 PM
Registered User
 
Join Date: Nov 2007
Location: ffps fspf, jjfgkfg, India.
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

Reply With Quote
  #2 (permalink)  
Old November 6th, 2007, 05:41 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
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
================================================== =========
Reply With Quote
  #3 (permalink)  
Old November 6th, 2007, 09:07 PM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
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)
Reply With Quote
  #4 (permalink)  
Old May 21st, 2013, 05:41 PM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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!
Reply With Quote
  #5 (permalink)  
Old May 22nd, 2013, 03:46 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
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
Reply With Quote
  #6 (permalink)  
Old May 22nd, 2013, 03:47 AM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
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)
Reply With Quote
  #7 (permalink)  
Old May 22nd, 2013, 10:33 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #8 (permalink)  
Old May 22nd, 2013, 10:35 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #9 (permalink)  
Old May 23rd, 2013, 10:00 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:48 AM.


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