Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread EDB User Count
Wed, Nov 5 2008 2:58 PMPermanent Link

"Terry Swiers"

Attached is a unit that will allow you to count users connected to either a
C/S or Local EDB database via a "slot" based mechanism.  With this, you can
allocate a slot for each instance of your application and count the number
of active slots to determine the number of instances of your application
running against a given database.  This code is self cleaning, in that it
will automatically remove dead or orphaned locks from improper shutdown from
the table if they are present.

--

---------------------------------------
 Terry Swiers
 Millennium Software, LLC
 http://www.1000years.com
 http://www.atrex.com

 Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

Atrex Electronic Support Options:
 Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
 Email: mailto:support@atrex.com
 Newsgroup: news://news.1000years.com/millennium.atrex
 Fax: 1-925-829-1851
 Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
 ---------------------------------------





Attachments: UserCount.pas
Fri, Nov 7 2008 1:36 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

A few alterations (I think they're improvements Smiley


Added :

 FAllows: integer; - number of logons allowed
 FInfo: string; - additional information (I'm using it for logon name)
 FCleanUp: boolean; - if true will delete table when last user logs off

Also added Info and When to the table

 procedure RemoveTable; - does the removal
 procedure GetActiveInfo(Info, When: TStringList); - gets the info list and time logged on into the stringlists supplied (allows me to have a display of who's active on the system)


Roy Lambert





Attachments: UserCount.pas
Tue, Nov 11 2008 3:37 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

This one is modified (with a little help from Tim) to be used at the application level. It creates a database in a specified disk location and will clean up after itself deleting both the table and the database.


The idea is that Terry's UserCount is linked to a database. If your app can connect to multiple databases and you have allowed set to 3 you can have 3 x databases using the app simultaneously. This version points all user access control to a single point.

WARNING - if you set the directory to the same as your data directory this could have nasty consequences possibly wiping the data - haven't tested it yet with AppUserCount but I know creating two databases in the one config file pointing to the same data and then DROPping does zap it. YOU HAVE BEEN WARNED

Roy Lambert





Attachments: AppUserCount.pas
Image