Subject | Re: [IBO] Getting the list of server users using Firebird 2.0 |
---|---|
Author | Daniel Albuschat |
Post date | 2006-06-19T10:05:17Z |
2006/6/2, Salim Naufal <mlists@...>:
other component, maybe IBOAdmin or so:
procedure GetDatabaseConnections(sl: TStringList; FDataBase: TIB_Connection);
var
local_buffer: array[0..IBHugeLocalBufferLength - 1] of Char;
temp_buffer: array[0..IBLocalBufferLength - 2] of Char;
DatabaseInfoCommand: Char;
i, user_length: Integer;
_Session: TIB_Session;
begin
_Session := TIB_Session.DefaultSession;
DatabaseInfoCommand := Char(isc_info_user_names);
isc_database_info(@_Session.status, @..., 1,
@DatabaseInfoCommand,
IBHugeLocalBufferLength, local_buffer);
i := 0;
while local_buffer[i] = Char(isc_info_user_names) do
begin
Inc(i, 3); { skip "isc_info_user_names byte" & two unknown bytes
of structure (see below) }
user_length := LongInt(local_buffer[i]);
Inc(i,1);
Move(local_buffer[i], temp_buffer[0], user_length);
Inc(i, user_length);
temp_buffer[user_length] := #0;
sl.Add(String(temp_buffer));
end;
end;
--
eat(this); // delicious suicide
> Hi,I'm using this delphi-function in my project. I think I copied it from some
>
> Is there a way of getting the list of users with IBO 4.6B and Firebird
> 2.0?
other component, maybe IBOAdmin or so:
procedure GetDatabaseConnections(sl: TStringList; FDataBase: TIB_Connection);
var
local_buffer: array[0..IBHugeLocalBufferLength - 1] of Char;
temp_buffer: array[0..IBLocalBufferLength - 2] of Char;
DatabaseInfoCommand: Char;
i, user_length: Integer;
_Session: TIB_Session;
begin
_Session := TIB_Session.DefaultSession;
DatabaseInfoCommand := Char(isc_info_user_names);
isc_database_info(@_Session.status, @..., 1,
@DatabaseInfoCommand,
IBHugeLocalBufferLength, local_buffer);
i := 0;
while local_buffer[i] = Char(isc_info_user_names) do
begin
Inc(i, 3); { skip "isc_info_user_names byte" & two unknown bytes
of structure (see below) }
user_length := LongInt(local_buffer[i]);
Inc(i,1);
Move(local_buffer[i], temp_buffer[0], user_length);
Inc(i, user_length);
temp_buffer[user_length] := #0;
sl.Add(String(temp_buffer));
end;
end;
--
eat(this); // delicious suicide