Delphi .NET (2) Database (71) Delphi IDE (89) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
List of all ALIASES pointing to a SQL server
This article has not been rated yet. After reading, feel free to leave comments and rate it.
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).
I came up with the following procedure, which I call like this:
GetAliases (ComboBox1.Items)
 | |  | | procedure GetAliases (const AList: TStrings);
var
i : Integer;
Desc : DBDesc;
Buff : Array [0..254] Of char;
begin
Session.GetAliasNames (AList);
for i := AList.Count - 1 downto 0 do
begin
StrPCopy (Buff, AList[i]);
Check (DbiGetDatabaseDesc (Buff, @Desc));
if StrPas (Desc.szDBType) = 'STANDARD' then
AList.Delete (i)
end
end; | |  | |  |
Comments:
|