Solved

Help getting list of users still using application

Posted on 2002-05-16
6
124 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi OLE Error 8 84
Convert Jpg /PNG To GIF 5 103
Delphi selector screen 2 58
Delphi inherited method 6 40
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

23 Experts available now in Live!

Get 1:1 Help Now