Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto checking DB Size (2000 (9.0.4402 SR-1))

    Is there a way with VB of checking the size of a DB? I would like to setup some form of pop-up or report that can do the check when a user logs into a respective DB and if reaching a certain threshold, though well before the 2gb limit, will allow the user to schedule the Compact routine.

    Cheers,

    Niven

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Auto checking DB Size (2000 (9.0.4402 SR-1))

    You can use code like this:

    Dim lngSize As Long
    lngSize = CreateObject("Scripting.FileSystemObject").GetFile (CurrentProject.FullName).Size

    lngSize will be the size of the .mdb (or .mde) file in bytes. To get kilobytes, divide lngSize by 2^10, to get megabytes, divide by 2^20.

    Note: if you use a split frontend/backend design, this will be the size of the frontend. Replace CurrentProject.FullName with the path+filename of the backend to retrieve the size of the backend.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto checking DB Size (2000 (9.0.4402 SR-1))

    Top stuff! Just what I was looking for.

    Cheers,

    Niven <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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