Listing Users in the Security Database

From InterBase

Go Up to Configuring Users


Use the DisplayUser and DisplayUsers methods to display information for a single user or all users respectively in the InterBase security database (admin.ib by default).

Displaying Information for a Single User

To view the information for a single user, use the DisplayUser method. The following code snippet displays all the information contained in the TUserInfoArray, keyed on the UserName field.

try
UserName := Edit1.Text;
DisplayUser(UserName);
Edit2.Text := UserInfo[0].FirstName;
Edit3.Text := UserInfo[0].MiddleName;
Edit4.Text := UserInfo[0].LastName;
Edit5.Text := IntToStr(UserInfo[0].UserID);
Edit6.Text := IntToStr(UserInfo[0].GroupID);
finally

Displaying Information for All Users

To view all users, use the DisplayUsers method. DisplayUsers displays the user information contained in the TUserInfo array. The following code snippet displays all users in a memo window.

try
  DisplayUsers;
  for I := 0 to UserInfoCount - 1 do
    begin
      with UserInfo[i] do
        begin
           Memo1.Lines.Add('User Name : ' + UserName);
           Memo1.Lines.Add('Name: ' + FirstName + ' ' + MiddleName +             ' ' + LastName);
           Memo1.Lines.Add('UID: ' + IntToStr(UserId));
           Memo1.Lines.Add('GID: ' + IntToStr(GroupId));
           Memo1.Lines.Add('-----------------------------------');
        end;
      end;
finally

Advance To: