|
<< Click to Display Table of Contents >> Delphi Examples: DbiOpenDatabaseList |
![]() ![]()
|
Return a list of of accessible databases and all aliases found in the configuration file.
This example uses the following input:
fDbiOpenDatabaseList(DatabaseList);
The procedure is:
procedure fDbiOpenDatabaseList(DatabaseList: TStringList);
var
TmpCursor: hDbiCur;
Database: DBDesc;
rslt: DbiResult;
begin
DatabaseList.Clear;
Check(DbiOpenDatabaseList(TmpCursor));
repeat
rslt:= DbiGetNextRecord(TmpCursor, dbiNOLOCK, @Database, nil);
if (rslt <> DBIERR_EOF) then begin
DatabaseList.Add(StrPas(Database.szName)
+ ' - ' + StrPas(Database.szPhyName)
+ ' - ' + StrPas(Database.szDbType))
end;
until (rslt <> DBIERR_NONE);
Check(DbiCloseCursor(TmpCursor));
end;