DelphiFAQ Home Search:
General :: Programming :: Delphi :: Database
Database development with Delphi. Includes issues with BDE, ADO and InterBase.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

List of all ALIASES pointing to a SQL server

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 
   // list all BDE aliases 
   Session.GetAliasNames (AList); 
   for i := AList.Count - 1 downto 0 do 
   begin 
     StrPCopy (Buff, AList[i]); 
     Check (DbiGetDatabaseDesc (Buff, @Desc)); 
     // no Paradox, please
     if StrPas (Desc.szDBType) = 'STANDARD' then 
       AList.Delete (i)
   end
 end; 

Generated 0:01:25 on Apr 23, 2017