Tips (1541)
uses Registry; procedure TForm1.Button1Click(Sender: TObject); var n: Integer; List: TStringList; Reg: TRegistry; begin Reg := TRegistry.Create; try Reg.RootKey := HKEY_CURRENT_USER; Reg.LazyWrite := False; Reg.OpenKey('Software\ODBC\ODBC.INI\ODBC Data Sources', False); List := TStringList.Create; Reg.GetValueNames(List); ListBox1.Clear; for n := 0 to List.Count - 1 do ListBox1.Items.Add(List.Strings[n]); Reg.CloseKey; finally Reg.Free; end; end;
Rate this tip: