Results 1 to 4 of 4

Thread: Compacting Access 2.0 Database in VB6

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    Hi all,

    Sorry for asking so many questions but I think this should be the last for now

    Is there anyway that I can write a code in VB6 to compact some Access 2.0 Database files (mdb)?

    Thanks!!

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175
    You can use the Search facility of this forum to find the answers to many of your questions (like this one), but here it is anyhow. This example also repairs the database.

    DBEngine.RepairDatabase "MyDB.MDB"

    DBEngine.CompactDatabase "MyDB.MDB"
    , App.Path & "compact.bak"
    Kill "MyDB.MDB"
    Name App.Path & "compact.bak" As "MyDB.MDB"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    Hi Martinliss,

    Thanks for the reply.

    For your method given, after compacting the databases, am I still able to open it with Access 2.0? (Cos I have both Access 97 and Acess 2.0 installed).

    Thanks!!


  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width