Retrieve Users connected to DB
Hi,
I am trying to write a form which can list the users connected to the current SQL Server Database in Access, only problem is I cant find a way of doing this without having security impacts on the server.
I can use the following SQL to get a list
select spid, status, loginame, hostname, blocked, db_name(dbid), cmd from master..sysprocesses where db_name(dbid) = 'AutoCost2008'
but if I run this for any user who does not have admin role then they can only see there own user.
Does anyone know how I can get arround this or open a form in an ADP project with a different SQL user instead of the user setup in File/Connection.
Thanks,
Gavin,
Hi,
I am trying to write a form which can list the users connected to the current SQL Server Database in Access, only problem is I cant find a way of doing this without having security impacts on the server.
I can use the following SQL to get a list
select spid, status, loginame, hostname, blocked, db_name(dbid), cmd from master..sysprocesses where db_name(dbid) = 'AutoCost2008'
but if I run this for any user who does not have admin role then they can only see there own user.
Does anyone know how I can get arround this or open a form in an ADP project with a different SQL user instead of the user setup in File/Connection.
Thanks,
Gavin,
Last edited: