PDA

View Full Version : Get Windows Login of Users connected to Access database



Jeevie
08-12-2011, 06:28 AM
Hi All

I dont know if this a repost but would appreciate any help on the following issue.

I have a MS Access database used by multiple users. At times, in order to shut down the database, I need to reach out to the users connected to the database. When I check the log file, I get the list of users with their respective machine names. How do I get the windows login names of the users connected to the database.

Thanks in advance.

HiTechCoach
08-13-2011, 12:12 PM
It is possible to send a message to the PC using the PC's name.

See: Net Send (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_send.mspx?mfr=true)


When I check the log file To which log are you referring?

Maybe your looking in the Access locking database (.ldb..lccdb)?

If a custom log file you could add the Windows user name. I use a Windows API to get the user name.

I assume that since this is a multiple user database that it has be split. What I do is use a flag file that tells the front ends that the database is off line. This prevent users from opening the front end. The current opened front ends look for the file at a regular interval and shuts down is needed.

Jeevie
08-14-2011, 04:36 AM
Using Net Send to message is not possible as it is disabled for security restrictions.

I am referring to the .ldb file. I could use a table with list of windows login names and system names stored but the users frequently change systems depending on availability and therefore this may not be a feasible solution.

Could you please explain your last line with a code example.
"What I do is use a flag file that tells the front ends that the database is off line. This prevent users from opening the front end. The current opened front ends look for the file at a regular interval and shuts down is needed."

Thanks for your response.



It is possible to send a message to the PC using the PC's name.

See: Net Send (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_send.mspx?mfr=true)

To which log are you referring?

Maybe your looking in the Access locking database (.ldb..lccdb)?

If a custom log file you could add the Windows user name. I use a Windows API to get the user name.

I assume that since this is a multiple user database that it has be split. What I do is use a flag file that tells the front ends that the database is off line. This prevent users from opening the front end. The current opened front ends look for the file at a regular interval and shuts down is needed.

HiTechCoach
08-15-2011, 08:13 AM
The first step is to split your database. Is your database split?

About the flag file:
I place a file in the same folder as the back end. I use the DIR() to test for the file at start up. To field the location of the back end see the links below.

See: Split Database links (http://www.hitechcoach.com/index.php?option=com_alphacontent&section=4&category=65&Itemid=32)