uses DB, DBTables, DBITypes, DBIProcs;
procedure TForm1.FormCreate(Sender: TObject);
begin
Session.GetAliasNames(ListBox1.Items);
end;
procedure TForm1.ListBox1Click(Sender: TObject);
var
tStr: array[0..100] of char;
Desc: DBDesc;
{
The DBDesc structure describes a database, using the following fields:
szName DBINAME Specifies the database alias name.
szText DBINAME Descriptive text.
szPhyName DBIPATH Specifies the physical name/path.
szDbType DBINAME Specifies the database type.
}
begin
if ListBox1.Items.Count = 0 then
exit;
StrPLCopy(tStr, ListBox1.Items.Strings[ListBox1.ItemIndex], High(tStr));
DbiGetDatabaseDesc(tStr, @Desc);
with Desc do
begin
Label1.Caption := StrPas(Desc.szName);
Label2.Caption := StrPas(Desc.szPhyName);
Label3.Caption := StrPas(Desc.szDbType);
Label4.Caption := StrPas(Desc.szText);
end;
end;
|