Displaying the Database Information
From InterBase
Go Up to Displaying Server Properties
Use the Database
option to display the TDatabaseInfo
record, which consists of the number of databases attached to the server, the number of databases on the server, and the names and paths of the database files.
You can set the Database
option to <True> in the Object Inspector, or set it in code.
The following code displays the elements of the TDatabaseInfo
record. NoOfAttachements
and NoOfDatabases
are strings displayed in Label
components, while DbName
is an array of type string, and displayed in a Memo
component.
Options := [Database];
FetchDatabaseInfo;
Label1.Caption := 'Number of Attachments = ' + IntToStr(DatabaseInfo.NoOfAttachments);
Label2.Caption := 'Number of Databases = ' + IntToStr(DatabaseInfo.NoOfDatabases);
for I:= 0 to High(DatabaseInfo.DbName) do
Memo1.Lines.Add(DatabaseInfo.DbName[i])