Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

list of odbc data sources

How do I get a list of current odbc data sources....
0
julianpointer
Asked:
julianpointer
1 Solution
 
ILECommented:
meybe you cen do this
to get all aliases

1.session.Getaliasnames(listbox1.items);

2.after taht put one tdatabase component and assign first alias
3.conect with database
4 test wiht database.issqlbased
5. goto 3

is this satisfacted you?
0
 
geobulCommented:
Hi,

Put a ListBox and a Button on a form and try this (ODBC data sources only, not BDE Administrator databases):

uses registry;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ListBox1.Items.Clear;
  with TRegistry.Create do begin
    try
      if OpenKey('\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources', False) then begin
        GetValueNames(ListBox1.Items);
        CloseKey;
      end;
    finally
      Free;
    end;
  end;
end;

Regards, Geo
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now