Solved

Help getting list of users still using application

Posted on 2002-05-16
6
126 Views
Last Modified: 2010-04-04
Hi,

I have written an app using Delphi 6 and SQL Server Database, to be used under Windows 2000 environment.

There are times when the application will need to be closed to perform end of month processes. I have written code which will lock users out upon entering the application, if the application is "CLOSED FOR MAINTENANCE"

My question is How do I get a list of users who are still using the application if they are already in the APPLICATION, so that I can tell them to exit ?

I would like to do this via Delphi Code, and I will not have access to SQL SERVER Administration once the application is deployed.

Thanks
pje
0
Comment
Question by:pjelias
6 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 7015541
listening
0
 
LVL 9

Accepted Solution

by:
ITugay earned 100 total points
ID: 7015562
Hi pjelias,

this way can be used in all types of database:

create service table and put there database status.
all applications on start and periodically checks that table.
if database going to be "under maintenance" then let user know about it and close application automatically.

------
Igor.
0
 
LVL 1

Expert Comment

by:JDN
ID: 7015615
Let you application create an 'in_use' file on the server for the user when he logs on to your program. This file must be deleted when the user logs off.
Check all the 'in_use' files currently on the server to determine the users logged on to your program.
I use this technique myself, very simple but it works fine.

JDN
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7015932
or broadcast an udp packet when you're going to do the maintainance to notify the already running apps to shutdown :)
all of the comps on the local network will receive this packet
then the running apps would reply and you would know "who" is still using the app
and when a new app is run it could also broadcast some kind of a packet and only the 'server' would reply
so you automatically know the path to the database :)
and the server could reply with the status 'OK' or 'MAINTAINANCE' :)
then when finished it could again broadcast a packet to notify the running clients (if any) that they can proceed
I'd do it that way :)
0
 
LVL 4

Expert Comment

by:max-hb
ID: 7015996
Hi!
I did something like that under MySQL using a client_list table (Fields: ClientID,admin_cmd)

1. On log on each client signs up in the table
2. If I want to do administrative work on the db I set a value like "logout" in the field admin_cmd
3. Clients do "select admin_cmd from client_status" from time to time and respond to the returned value (e.g. "logout" results in deleteing the client entry in the table and *surprise* logging out)
4. Clients that do not respond in a predefined amount of time are assumed to be non active and are removed from the table
5. If the table is empty I can assume no one is logged in an do administrative work

Not really cool stuff, but it works.
0
 

Author Comment

by:pjelias
ID: 7109822
Easy way

thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now