Results 1 to 3 of 3
  1. #1
    toolpusher is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    2

    Database opens for one user only

    Hi



    I have a Access DB that is not spilt to front end back end for which I know is the way to do it for multiple users but I cant do that for various reasons that I wont go into. The database is set with a password which should make it exclusive? The problem I have is if two users try to open the DB using the password they are able to? I don't want this I want it to be like a MS spreadsheet when its set for exclusive use the second party gets a message that the spreadsheet is in use and he needs to wait until the first user shuts it down.

    Is this achievable with access

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    8,422
    you should make another FE db, (not split , a second db with nothing in it)
    this db would check to see if the main db is open (via the .laccdb) if file exists, give user the message,
    if not, open the main db.

    Code:
    
    sub Check2Open()
    if fileexists("\\server\folder\mydb.laccdb") then
       msgbox "Db is open"
    else
       call shell("c:\msAccess.exe  '\\server\folder\mydb.accdb'")
    endif
    end sub
    
    
    
    Public Function FileExists(ByVal pvFile) As Boolean Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") FileExists = FSO.FileExists(pvFile) Set FSO = Nothing End Function


  3. #3
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,576
    never tried it but you could try setting the 'open exclusive' option

    File>Options>Client Settings---Advanced

    however this means second user can probably still open the db, but won't be able to change data (like opening excel readonly). As I said, I've not tried it, you would need to check

    Another way would be to have a simple table with an 'already open' flag. When a user opens the db the flag is checked and if false the flag is set to true (and reset to false when the user exits the app). If the flag is already true then the user gets a warning message 'already in use' and the app is closed.

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

Similar Threads

  1. Replies: 5
    Last Post: 10-09-2017, 03:09 PM
  2. User only opens DB in Exclusive mode
    By DB88 in forum Access
    Replies: 18
    Last Post: 06-05-2014, 11:24 AM
  3. Replies: 3
    Last Post: 09-27-2013, 07:56 AM
  4. Replies: 6
    Last Post: 08-07-2012, 02:44 PM
  5. Replies: 1
    Last Post: 03-07-2011, 10:48 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 - Senior Forums