determing if a user is already logged on to a database 
Author Message
 determing if a user is already logged on to a database


In SQL Server there is a sysprocesses system table, which keeps information
about active processes. On of fields in that table is UID, which specifies
id of user and LOGINNAME field, which specifies actual login for user. Also
have a look into SP_WHO stored procedure, which returns information about
current active users and processes

Val Mazur
Microsoft MVP

> Hey everybody,
>      I'm using VB 6.0 and SQL Server 2000. Is there a way
> to programically test from VB (I'm guessing using SQL
> DMO?) if a specific user is already logged into a
> database? For example, if user "Bob" is already logged
> into the database and someone else wants to log in as
> user "Bob", I want to pop up a message saying: "Sorry,
> user 'Bob' is already logged on." and exit the logon
> routine.  Can anybody help me out? Thanks a lot in advance.

> Joe

Sat, 21 May 2005 20:42:06 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Logging Users off an Access Database

2. listing NT logon names of logged on users to database

3. How to view Logged-on user in Database

4. Which Users are currently logged into a database?

5. Users logged into a MDB database

6. Determining current users logged on to database

7. How do i make a server program that will log and log off other users

8. Determing User and Icons on Desktop

9. Determing Dir where my app is stored on a users machine

10. Current Domain User Name of logged in user?

11. Determing available database servers (MS SQL)

12. Programmatically kill user connection/log user off server.


Powered by phpBB® Forum Software