Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually, two questions: i want to create a form load() event that detects the size of the current db and displays a button for the user to click so they can compact the db. these guys grow quickly.

    the other question is, what was that utility that searches your code and forms to find unused code? i am aiming to finalize this project and perhaps compile it to MDE to protect the code base. i'm sure there's some unused object sitting around so i wanted to tighten things up a bit.

    TIA!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The size of the active database in bytes is FileLen(CurrentDb.Name)
    You can divide this by 1024 to get kilobytes or by (1024 * 1024) to get megabytes.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Note that if you are using a front-end, back-end design (and if you aren't you should be), then you would need to look at the size of the linked database, not the current database. One trick we sometimes use with front-ends where we really want to lock it down is to make it read-only - that presumes of course that you aren't making temporary tables and such in the front-end database, which we normally don't do.
    Wendell

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    To compact the current database: see General - Compact the Current Database from Code.

    To compact another database: DAO has a CompactDatabase method, but you MUST specify a different name for the target database. If you want to emulate the interactive behavior, you must:
    • Compact the database to a new database.
    • Verify that the new database has really been created.
    • Delete the original database.
    • Rename the new database to the name of the old one.
    Keep in mind that if you want to compact the backend from a frontend, all connections to the backend must have been closed, otherwise the backend will be "in use".

    The utility that you mean might be Total Access Analyzer (it's pricy!)




  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I used the method referred to for compacting the current db - works fine! i had the code from a previous project, just forgot I had it...

    i am not implementing a backend for this project as the whole point is to allow people to take a copy off-line for work in the field. the real backend is SQL Server, FWIW.

    I don't want to spend any money to clean up the db so guess i'll do that by hand... painful perhaps, but i know who to blame...

Posting Permissions

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