Subject Re: how do i know how many Users are connectet to my Database
Author Olivier Mascia
[Posted to the developers list, copied to firebird-support for further
discussion if needed.]

Monday 20 Oct 2003, 09:01, Frank Schäfer écrivait :

> i want to make an automatic backup, and i have to know
> how many Users are connectet to my Database. With IBOConsole
> i can see it (Connected Users). How can i get this Information in
> my Application ??

Please, there are a number of resources (lists and newsgroups) for
support questions. This firebird-devel@... list is
for Firebird Server developers communication.

Anyway, I'm pleased to bring you this answer :

Use the isc_database_info() C-API call, passing it a parameter buffer
containing something like :

char items[] = {isc_info_user_names,
isc_info_end};

This will return you a list of the connected user names :

while (*p == isc_info_user_names)
{
p += 3; // Get to the length byte
int len = (int)(*p);
++p; // Get to the first char of username
if (len != 0) // You have got a username
p += len; // Skip username
}

Okay this is partially quick and dirty code not intended to compile as
is. But you get the idea.

Whatever client access tool you use, most probably that library has a
method to give you this answer.

If there are followups to this question, please do so on
firebird-support@yahoogroups.com.

Thanks !

--
Best Regards,
Olivier Mascia