Question Who is using my database on the Network (1 Viewer)

khodr

Experts still Learn
Local time
Today, 02:55
Joined
Dec 3, 2012
Messages
112
Hi,
I am new to this forum, I am an access database developer, am not that high level expert but I can do enough to let it work, My question is, I need to know who is using my database, Kick users, and restrict another from using, I have an access database which is running on the Network and I used access 2010 to build it up, any help will be appreciated.
regards.
khodr.:)
 

khodr

Experts still Learn
Local time
Today, 02:55
Joined
Dec 3, 2012
Messages
112
Yes Sure,
I have a main application form (the Parent form) it will launch within the application loading and then every user has to enter his name and password, and I already made a Level for users, to direct them to user panel as per their user level.
I will go through the link which you provided me thanks a lot mate.
;) regards.
khodr.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:55
Joined
Feb 28, 2001
Messages
27,193
The basic concept is simple, using the "Old Programmer's Rules"

Access can't tell you anything you didn't tell it first. If you want to know who is in, you have to have a login mechanism AND a logout mechanism and a LOGIN table. When someone logs in, make a date/time entry, a username entry, whatever else you might want to know later. Then scrupulously trap every form so that when it closes (OnClose event), you update the table in question to show that the user logged out.

If your user account table has a flag that says "go away and don't come back" then your login process, if tight enough, can do a DoCmd.Quit on unwanted users.

To kick users already in, you need a timer event on your main application panel, which can never close until the entire application is closing. Because what you have to do then is have a timer fire every so often to check whether a particular entry has been made in some sort of "control" table that holds flags and statuses generic to all users. When you set the "Non-supervisors must die" flag in that table, have the timer code kick everyone out who isn't in your user-level table as a supervisor (or whatever role name you choose to apply.)
 

khodr

Experts still Learn
Local time
Today, 02:55
Joined
Dec 3, 2012
Messages
112
You are really a great help, the_Doc_Man
I understood exactly what I have to do now and that will be great as far as I am the database creator so I can control every form and write whatever code fits with the mechanism of logic ahhhh how I didn't think about this before, but you taught me a lot with your reply and really thx so very much
Regards
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:55
Joined
Feb 28, 2001
Messages
27,193
Just one last word of warning. If you have network glitches, this doesn't work perfectly. I.e. if someone didn't exit but rather was forcefully disconnected, the "Logout" event won't occur and you will get what appears to be a person logged in twice. You might also get what appears to be someone logged in longer than 24 hours if they log in, get dropped by a network event, and don't come back for at least a few days. So take that login table with a grain of salt.

The problem is really that unless you can see some Windows internal structural tables on the server that holds your shared data tables, i.e. look at the file handles currently open on your shared-file's server, you cannot REALLY tell who is connected.

The way we handle that is we have a setup based on domain logins. We can get a username and computername (spelled as noted) from the Environ function (or some such name as that). So we just store the username and computername. As it happens, that same information is ALSO stored in the .LDB or .LACCDB file which you can open with notepad and see the computer names of who has current Access locks.
 

khodr

Experts still Learn
Local time
Today, 02:55
Joined
Dec 3, 2012
Messages
112
I will do it the simple way,
I designed the database to work as back-end & front-end my front end is accde file, after I write my codes I compile it and the I convert the front-end after routing the back_end on the server then I give the updated front-end accde file to the users.
Now what I will do is:
A) i will add two more fields to my users table. Login_status and kick_out
B) In the user login form I will add the combo ctrlLogin_status and write the code if user name and password is correct then the ctrlLogin = logged_in and it will continue to login the user
Else the login_status already set to logged out by default.
I will the create my users status form and link it to users table on the back_end and based on time interval code and the users action I will see who is in and who is out.
C) regarding to kick out from the database, on my form where I watch the users status I can set the value for kick_out check box to -1 where the default is 0
In the main user login form I will set the time interval every 3 minutes to check the value of the kick_out then if the value is true a modal on top pop_up form messages tells the user "your database has been set to quit by your administrator within one minute for more info contact your database administrator" after 1 minute another time interval will be active on this message form to save all the work and quit the whole database safely.

I think by then that's how I can get what I am looking for, by the way am not a programmer I am a printing technology engineer my brain function better with printing process colors world inks printing machines pre_press techniques and so, thus I may mesothelioma codes some times but still I get what I want and with this site I think I will learn a lot thanks again
Regards
 

Users who are viewing this thread

Top Bottom