Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help getting list of users still using application

Posted on 2002-05-16
6
Medium Priority
?
133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 7015541
listening
0
 
LVL 9

Accepted Solution

by:
ITugay earned 300 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

705 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