uses
Registry;
procedure TForm1.Button2Click(Sender: TObject);
var
reg:TRegistry;
begin
combobox1.Clear;
combobox2.Clear;
//('系统DSN: ');
reg:=Tregistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
if Not reg.OpenKey('/SOFTWARE/ODBC/ODBC.INI/ODBC Data Sources',false) then
showmessage('false');
reg.GetValueNames(combobox1.items);
Reg.CloseKey;
//('用户DSN: ');
reg.RootKey:=HKEY_CURRENT_USER;
if Not reg.OpenKey('/SOFTWARE/ODBC/ODBC.INI/ODBC Data Sources',false) then
showmessage('false');
reg.GetValueNames(combobox2.items);
Reg.CloseKey;
reg.Free;
end;