Solved

Help getting list of users still using application

Posted on 2002-05-16
6
132 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 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
Technology Partners: 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!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

615 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