Results 1 to 5 of 5
  1. #1
    Enioch is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2022
    Posts
    4

    Database not closing properly; process still present in task manager. I'm probably missing something

    Hello again, good accesspeople.

    I have this access database (too big for the site): https://www.dropbox.com/s/cykuqpzgsk...WIP.accdb?dl=0

    It's currently very WIP, and I'm sure there are problems (especially since I haven't touched Access in years and my experience with it has been minimal to begin with), so I'd like some help, as it is giving me some trouble:

    Currently, if I close Access, a process remains in use (still visible in the Task Manager). This means that if I double-click the file, it doesn't open Access (or rather it starts a new process in the background, but the GUI never appears). My amateur diagnosis is that I'm not closing the file properly; I've opened / created / coded something that remains working in the background and it prevents the database from closing completely. Add to that the notable bloat that I've seen, and I'm growing suspicious.

    The file that you see used to be an 8MB file. I re-imported everything into a new blank file and the DB immediately shrunk to something more realistic (~700KB), but a test run showed already tendencies to bloat up again.



    I have tried to compact and repair, but I get a message that "Could not access file XXX (Database path) ; file already in use". That is the case even if I have previously closed all other existing Access processes.

    Could the clever people here have a look and let me know what I'm missing, if anything?

    The main form is "Ships".

    Many thanks, good accesspeople.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    See if this helps:

    https://www.devhut.net/access-lock-file-issues/

    I had the same problem, had to revert to a previous version.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Enioch is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2022
    Posts
    4
    Yup, that bloody well did it. Goddammit, Microsoft , and thanks a lot pbaldy!

    Out of curiosity, and with regards to the bloating - is that normal for Access, or am I doing something wrong in my code?

    I read in various places on the webz that I should be closing things and / or setting them to "nothing", but I don't see where that would go in my code (or if it's even necessary, given how I've written it).

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Access VBA discards object variables when procedure ends but doesn't hurt to explicitly close/set. See examples in

    http://allenbrowne.com/ser-23a.html

    http://allenbrowne.com/func-DAO.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Bloating can result from append and make table queries, etc. A compact/repair will usually bring the file size back down.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-09-2021, 08:52 AM
  2. Replies: 9
    Last Post: 11-05-2017, 05:20 AM
  3. Closing WINWORD Background Process
    By Forbes in forum Programming
    Replies: 7
    Last Post: 10-21-2017, 04:59 PM
  4. I'm not closing off Excel properly I think?
    By stildawn in forum Modules
    Replies: 7
    Last Post: 05-01-2014, 05:12 PM
  5. please use linked table manager to properly attach database
    By Chris Acker in forum Database Design
    Replies: 2
    Last Post: 10-23-2013, 09:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums