Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monitoring Connections in to a DB - Logic or Howto!! 1

Status
Not open for further replies.

x508

Programmer
Jun 26, 2003
396
ZA
Hi.

I need to check that a user does not log onto my app twice, by this I mean that it might sometimes happen that two users use the same username and password, at the same time, from two different locations, connecting to my DB.

I wish to "check" if the account/user is allready logged into the DB.

I suppose I can write a update script which updates a field in the DB, and writes the account of whoever has logged in. This will pose a problem if the app unexpectedly terminates or the power cuts, leaving my app not being able to "clear" the field in the DB....hence next time he/she loggs on, it will tell them that the user is allready logged on!!!

Any ideas or suggestions will be greatly appreciated.

*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
I have a piece of code that writes the user and their log-on time to a database. Using the timer, they then update their log-on every x minutes. When they log off, their entry in the db is deleted, as you suggested. However, when they log on again, if the time they last logged on is more than x+2 minutes ago, then the user has logged out without deleting their last entry. As I have set the time to update every 5 minutes, and only allow entry if the user logged use more than 10 minutes ago, this system means that the user may get locked out, but only for 10 minutes at the most. If you have a main administrator running on a network ,they can also check to see of the time for any entries is more than 5 minutes, and delete all records that are too old.

BB
 
Excellent Idea BB

I shall try this...you have one on me

*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top