Hi
Is there someone who know an easy way, so only one user can access a MS Access db without using users/groups in the database? It should be done by only knowing that someone is logged in/or opening the database?
I have made a part of a solution with a little login-screen and you only provide your initials and when click "Login" and when I execute the following sql:
strSQL = "Insert into login_info (Login,CurrentU ser, loggedIn) Values ('" + Txt_login.Value + "','" + FindUser.fOSUse rName + "',1);"
CurrentDb.execu te strSQL
But before a user can login to the application I have to check if there is already one user who have the flag "LoggedIn" set to 1 (Yes).
After the User is finished using the application there should be an update statement where the flag "LoggedIn" is set to 0...
I have two problems/questions:
1) How do I make the check for the flag... I'm new to MS Access and have read a lot, but I can't really find a way to open the recordset with the sql (select * from login_info where LoggedIn = 1) and check the field "LoggedIn" in some If... then... else sentense...
2) Is there some other way to make a MS Access database work in single user mode? Maybe some way to set some kind of isolation level to the database or table access... ex. writing some code in the private sub form_open(Cance l as Integer)...?
The most important in my application is that only one user can log in and write to the application and all other user should have a message that someone else is editing...
Regards
Is there someone who know an easy way, so only one user can access a MS Access db without using users/groups in the database? It should be done by only knowing that someone is logged in/or opening the database?
I have made a part of a solution with a little login-screen and you only provide your initials and when click "Login" and when I execute the following sql:
strSQL = "Insert into login_info (Login,CurrentU ser, loggedIn) Values ('" + Txt_login.Value + "','" + FindUser.fOSUse rName + "',1);"
CurrentDb.execu te strSQL
But before a user can login to the application I have to check if there is already one user who have the flag "LoggedIn" set to 1 (Yes).
After the User is finished using the application there should be an update statement where the flag "LoggedIn" is set to 0...
I have two problems/questions:
1) How do I make the check for the flag... I'm new to MS Access and have read a lot, but I can't really find a way to open the recordset with the sql (select * from login_info where LoggedIn = 1) and check the field "LoggedIn" in some If... then... else sentense...
2) Is there some other way to make a MS Access database work in single user mode? Maybe some way to set some kind of isolation level to the database or table access... ex. writing some code in the private sub form_open(Cance l as Integer)...?
The most important in my application is that only one user can log in and write to the application and all other user should have a message that someone else is editing...
Regards
Comment