Requesting Database Information

From InterBase

Go Up to Requesting Information about an Attachment


This section gives an example of how to use the TIBDatabaseInfo component.

To set up a simple TIBDatabaseInfo component:

  1. Drop a TIBDatabase component and a TIBDatabaseInfo component on a Delphi form.
  2. Using either the Object Inspector or the Database Component Editor, set up the database connection. For more information, see Connecting to a Database Server.
  3. Set the TIBDatabaseInfo component’s Database property to the name of the TIBDatabase component.
  4. Connect the TIBDatabase component to the database by setting the Connected property to <True>.
  5. Drop a Button component and a Memo component on the form.
  6. Double-click the Button component to bring up the code editor, and set any of the TIBDatabaseInfo properties described above. For example:
procedure TForm1.Button1Click(Sender: TObject);
var
  I: Integer;
begin
with IBDatabaseInfo1 do
 begin
   for I := 0 to UserNames.Count - 1 do
  Memo1.Lines.Add(UserNames[i]);
  Memo1.Lines.Add(DBFileName);
  Memo1.Lines.Add(IntToStr(Fetches));
  Memo1.Lines.Add(IntToStr(CurrentMemory));
 end;
end;

Advance To: