Board index » delphi » Restricting a user to logging on to a server only once

Restricting a user to logging on to a server only once

Anyone know how to detect if a connection has already been made by a user on
SQL Server 6.5.  What I want to do is prevent them running the same
application on two machines at the same time. There has to be some way to
query the server and see how many (if any) connections exist for a
particular user.  Can anyone help?

Cheers, John.

 

Re:Restricting a user to logging on to a server only once


the stored procedure sp_who returns the user name and application name of
all the current connections.
Of course, you have to have a connection to execute sp_who, but you could
potentially use the results of sp_who to determine if more than one
connection was made.
A potentially simpler implementation would be to write to a table when you
application starts and remove that entry when it ends.  (don't forget to
handle exceptions).

TLR

Quote
John Faris <johnfa...@hotmail.com> wrote in message

news:83qvkp$bad3@forums.borland.com...
Quote
> Anyone know how to detect if a connection has already been made by a user
on
> SQL Server 6.5.  What I want to do is prevent them running the same
> application on two machines at the same time. There has to be some way to
> query the server and see how many (if any) connections exist for a
> particular user.  Can anyone help?

> Cheers, John.

Other Threads