Question please help for access and remote desktop (1 Viewer)

aahhmmeedd

New member
Local time
Yesterday, 19:38
Joined
Oct 19, 2017
Messages
1
I want the steps to disable my access file work on many pc with remote desktop program in win server and only one can open it at one pc , beause there are many users can log in the access file at the same time
Please help me to save my file
 

Ranman256

Well-known member
Local time
Yesterday, 22:38
Joined
Apr 9, 2015
Messages
4,339
access files are built to allow many users to operate it at the same time. (if you split the file)
if you DONT want this,then make a startup 'front gate' database.
it opens a form with 1 button ,btStart, if nobody is in the actual database, it enables the button, which launches the actual database.

Code:
   'the start button enables if nobody is in the database
private form_load()
btnStart.enabled = IsLoginOK()    
end sub

private btnStart_click()
  call shell("c:\program files\msAccess.exe  F:\folder\MyDatabase.accdb")
end sub


public function IsLoginOK() as boolean
IsLoginOK = not FileExists("F:\folder\MyDatabase.lccdb")
end function


Public Function FileExists(ByVal pvFile) As Boolean
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
FileExists = fso.FileExists(pvFile)
Set fso = Nothing
End Function
 

isladogs

MVP / VIP
Local time
Today, 02:38
Joined
Jan 14, 2017
Messages
18,186
As already pointed out, you should split the db.
However if you decide to use Ranman's suggestion, there is a typo

It should read laccdb NOT lccdb
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:38
Joined
May 7, 2009
Messages
19,169
Testing for tge existence of. laccdb file does not guarantee that the db is in use. User can abnormally terminate the db or power outage can keave this file. If that happens, we can have a lockout and nobody will be abke to use the db using post 3 method.
The best way to test is if you can open the db exclusively.
 

Users who are viewing this thread

Top Bottom