CodeItBetter Programming Another VB Programming Blog

How to compact an Access Database from VB

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'Database - How to compact an Access Database from VB

'Add reference to DAO (Project -> References, select the Microsoft DAO 3.6 (or 3.51) Object Library)

'If you get "Unrecognized Database format" error message:

'If you using database that made in Access 2000 and you don't have Microsoft DAO 3.6 Object Library reference,
'click on browse, and select the file C:\Program Files\Common Files\Microsoft Shared\Dao\dao360.dll
'(If you have Access 2000 installed in your computer you have this file.)

'This will add Microsoft DAO 3.6 Object Library reference to your project.

Private Sub Main()
    DBEngine.CompactDatabase "C:\Temp\Test.mdb", "C:\Temp\Test1.mdb"
End Sub

Related posts:

  1. How to List all Tables from an Access Database
  2. How to set a password for an access database
  3. How to Import SQL Server data into an Access database
  4. How to change the password of an Access Database
  5. How to export data from the current database to a back-up database using Access Application
  6. How to Export an Access Database to HTML file
  7. How to Print MS Access Report
  8. How to Copy data from an Access database into an Excel spreadsheet using a SQL SELECT statement
  9. How to open a password protected access database using ADO
  10. How to Open a password-protected Access database with ADO

Filed under: Database Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.