Autor Beitrag
majolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Fr 24.01.03 14:27 
Hi Leute,

wie kann ich alle auf dem Computer installierten ODBC Treiber auslesen und in eine ListBox oder ComboBox hinzufügen. das Verfahren ist ja eh gleich. Habe leider in der Hilfe nichts gefunden. Wundert mich eigentlich,dass dieses noch niemanden interessiert hat.
Danke.
Gruss
majolo
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Fr 24.01.03 14:33 
Hallo,

Zitat:

dass dieses noch niemanden interessiert hat


warum auch? Den Treiber, den ich benötige kenne ich. Ich weiss auch nicht was mir das bringen soll, weil, mit einem Access-ODBC kann ich nicht auf eine DB2-Datenbank zugreifen.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Fr 24.01.03 14:47 
@smiegel:

Tja, aber man könnte so was ja eventuell für ein Datenbank-Admin-Tool brauchen ... Nur weil Du es noch nie gebraucht hast, heißt das ja noch nicht, dass es keinen interessiert. Ich selbst hatte im alten Delphi-Forum dieselbe Frage gestellt...

@majolo:

Die ODBC-Sockets stehen alle in der Registry. Ich weiß nur nicht genau, wo, aber irgendwo unter HKEY_LOCAL_MACHINE. Such am Besten einfach mal im regedit nach einem Socket-Namen.

Viele Grüße,

Matthias

_________________
Ha! Es compiliert! Wir können ausliefern!
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Fr 24.01.03 20:12 
@NeoJones: Vielen Dank, da werde ich mal suchen.
@smiegel: Ich kenne den Treiber auch. Jedoch soll der User den TREIBER für seine DB aussuchen können. :wink:
Naja, vielleicht weiß einer den Registryeintrag oder noch eine andere lösung.

Gruss
majolo
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Fr 24.01.03 23:16 
Habe meine Registry von oben bis unten durchforstet.kann leider den Eintrag nicht finden. Weiß einer die Registrydatei und gibt es noch eine andere Lösung??

Gruss
majolo
Simon Joker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236
Erhaltene Danke: 1



BeitragVerfasst: Mo 27.01.03 12:10 
Schau hier:

-installierte Treiber
HLM/Software/ODBC/ODBCINST.INI/ODBCDRIVER

-Treibereinstellungen
HLM/Software/ODBC/ODBCINST.INI/<Treibername>

-Eingerichtete Verbindungen
HLM/Software/ODBC/ODBC.INI/<Verbindungsname>
GuGl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 35



BeitragVerfasst: Mo 27.01.03 15:04 
Hi, ich habe das mal gebraucht:


ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
procedure TForm1.GetDataSourceNames(System: Boolean);
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  try
    if System then
      reg.RootKey := HKEY_LOCAL_MACHINE
    else
      reg.RootKey := HKEY_CURRENT_USER;

    if reg.OpenKey('\Software\ODBC\ODBC.INI\ODBC Data Sources', False) then
    begin
      if system then reg.GetValueNames(liste1)
      else reg.GetValueNames(liste2);
    end;

  finally
    reg.CloseKey;
    FreeAndNil(reg);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
   i : integer;
begin
  liste1 := TStringlist.create;
  liste1.clear;
  liste2 := TStringlist.create;
  liste2.clear;
  //System DSNs in liste1
  ListBox1.Items.Clear;
  ListBox1.Items.Add('SYSTEM DSN :');
  ListBox1.Items.Add(' ');
  GetDataSourceNames(true);
  for i := 0 to liste1.count - 1 do listbox1.items.Add(liste1[i]);
  //User DSNs in liste2
  ListBox1.Items.Add(' ');
  ListBox1.Items.Add('USER DSN :');
  ListBox1.Items.Add(' ');
  GetDataSourceNames(false);
  for i := 0 to liste2.count - 1 do listbox1.items.Add(liste2[i]);
  liste1.free;
  liste2.free;
end;


Hoffe das hilft weiter

_________________
Gruß, GuGl
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Mo 27.01.03 20:03 
danke, das sieht schon präziser aus. Werde es gleich mal ausprobieren.
Gruss
majolo