Subject | RE: [IBO] How to find out number of loggedin users |
---|---|
Author | Kaputnik |
Post date | 2001-11-27T13:23:35Z |
TIB_Connection.users will return you a StringList with all the Usernames
logged into the Database.
This list will include also the names several times, if one user has
several connections to the DB.
Thus,
TIB_Connection.users.count will give you a total number of connections
to the Database, while this small (untested) script will give you all
distinct users:
Function getDistincUsers : integer;
var
...
begin
myStringlist:=TIBConnection.users;
myStringlist.sorted:=true;
i:=1;
while i<myStringList.count do
begin
if myStringlist[i]=myStringlist[i-1] then
myStringList.delete(i)
else inc(i);
end;
result:=myStringlist.count;
end;
Note, this is untested and created from memory, but the general
direction should become clear.
Please don't anybody stand up to correct my listing, as I know it might
be completely wrong :-)
Nick Josipovic
BIT Institute
Prof. Dr. Franz Steffens
University of Mannheim
T: ++49 621 181 1621
M: ++49 179 133 44 16
S: ++49 621 181 1622
F: ++49 621 181 1618
nick.josipovic@...
__
__
logged into the Database.
This list will include also the names several times, if one user has
several connections to the DB.
Thus,
TIB_Connection.users.count will give you a total number of connections
to the Database, while this small (untested) script will give you all
distinct users:
Function getDistincUsers : integer;
var
...
begin
myStringlist:=TIBConnection.users;
myStringlist.sorted:=true;
i:=1;
while i<myStringList.count do
begin
if myStringlist[i]=myStringlist[i-1] then
myStringList.delete(i)
else inc(i);
end;
result:=myStringlist.count;
end;
Note, this is untested and created from memory, but the general
direction should become clear.
Please don't anybody stand up to correct my listing, as I know it might
be completely wrong :-)
Nick Josipovic
BIT Institute
Prof. Dr. Franz Steffens
University of Mannheim
T: ++49 621 181 1621
M: ++49 179 133 44 16
S: ++49 621 181 1622
F: ++49 621 181 1618
nick.josipovic@...
> -----Original Message-----IBO
> From: Riho-Rene Ellermaa [mailto:r.ellermaa@...]
> Sent: Tuesday, November 27, 2001 2:06 PM
> To: IBObject (E-mail)
> Subject: [IBO] How to find out number of loggedin users
>
> The subject says it all.
> I found a C++ sample for Interbase API, but I would like to know does
> support this________________________________________________________________________
>
> Riho-Rene Ellermaa
> senior programmer
> Hansabank
>
>
__
> _________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
>
__
> _http://docs.yahoo.com/info/terms/
> http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to
>