Subject Re: [IBO] Getting number of active users via MON$ATTACHMENTS?
Author Chuck Belanger

Thank you, MLCVISTA.

Noticed that IBODatabase is a TDataset. I guess I was not clear. I do not need IBODataset, I meant IBObjects by "IBO."

Anyway, I did try to use IBODatabase and it has the same issue as IB_Connection.Users.Count. Count is not limited to active users (i.e. MON$State = 1).

Any suggestions?

Thank you,

Chuck

On 1/3/2019 6:51 AM, Michel LE CLEZIO mlcvista@... [IBObjects] wrote:
Hello,

I use : Datamodule.IBODatabase.Users.Count...

Maybe this could help you...

Best regards
MLCVISTA

Le jeudi 3 janvier 2019 à 15:41:55 UTC+1, Chuck Belanger phytotech@... [IBObjects] <IBObjects@yahoogroups.com> a écrit :


 

Hello:

How do we get the number of active users with IBO?

I tried to simply use a IB_Cursor with:

SELECT * FROM MON$ATTACHMENTS WHERE MON$STATE = 1

But if I connected or disconnected from the database via IBExpert, the
count stays the same. Although, querying in IBExpert gives the correct
number of active connections, i.e. 2, one for my program and one for
IBExpert.

As I experimented with different approaches, I noticed something that
might be a clue:

When I checked the MON$ATTACHMENT_ID in my code it was always the same
from record to record and consistently up around 10x17th power, although
different from one query to another. The actual IDs are 4 digits long,
and of course, different for each record.

Tried using IB_Connection.Users.Count but that includes all active and
inactive users. I could not find a way to isolate only active users.

Thank you for any help or suggestions!

Chuck Belanger

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Virus-free. www.avast.com