Results 1 to 2 of 2

Thread: Compacting Password Protected Access DB

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Posts
    5

    Post

    Please do not send me to read help about CompactDatabase function. I did it many times. I have DB "MyDB.mdb" with Password "MyPassword" located on C:\. I'd like somebody give me exact code to compact MyDB from VB. And second question: how to find out if somebody is connected to that database through network before compacting.
    Thank you.
    Vlad

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Raleigh, NC
    Posts
    70

    Post

    I assume that you tried...

    DBEngine.CompactDatabase "C:\MyDB.mdb","C:\MyNewDB.mdb",,";pwd=MyPassword"

    and it didn't work?

    If you attempt to do the compact, you should be able to trap the error that says someone is still in the database. Or you could look at the Users collection

    for i = 0 to dbengine.workspaces(0).users.count -1
    dbengine.Workspaces(0).Users(i).Name
    next i


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