Author: Tomas Rutkauskas
For a little tool, I recently needed to get a list of all aliases which point to a
SQL db. (I did not want to see those Paradox files).
Answer:
I came up with the following procedure, which I call like this:
1 2 GetAliases(ComboBox1.Items)
3 4 procedure GetAliases(const AList: TStrings);
5 var6 i: Integer;
7 Desc: DBDesc;
8 Buff: array[0..254] of char;
9 begin10 // list all BDE aliases11 Session.GetAliasNames(AList);
12 for i := AList.Count - 1 downto 0 do13 begin14 StrPCopy(Buff, AList[i]);
15 Check(DbiGetDatabaseDesc(Buff, @Desc));
16 // no Paradox, please17 if StrPas(Desc.szDBType) = 'STANDARD' then18 AList.Delete(i)
19 end20 end;