Autor Beitrag
acnut
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 172
Erhaltene Danke: 3

Windows 7, Windows Vista, Windows XP, Ubuntu, Kubuntu, Pardus
Delphi 2010 SV, Java Editor, VS 2010 SV
BeitragVerfasst: Mo 01.02.10 17:09 
ein wert soll aus dem combobox gelesen werden und dann soll das gewählte item im memofeld mit "mehr infos ausgegeben werden".
aber wie mach ich das,dass die infos NUR für das gewählte item angezeigt wird und nicht wie jetzt von allen feldern?

hier ist mein bisheriger code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
 ADOQuery1.close;
 ADOQuery1.SQL.clear;



ADOQuery1.SQL.Add('SELECT * FROM Tabelle1');
 ADOQuery1.open;

  While not ADOQuery1.Eof do begin
    Memo1.Lines.Add(ADOQuery1.FieldValues['Adminlogin','Homepage','Admin Pass']);

    ADOQuery1.Next;
 end;

 Adoquery1.close;
end;



mfg
ffgorcky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 573

WIN XP/2000 & 7Prof (Familie:Win95,Win98)

BeitragVerfasst: Mo 01.02.10 18:36 
user profile iconacnut hat folgendes geschrieben Zum zitierten Posting springen:
ein wert soll aus dem combobox gelesen werden und dann soll das gewählte item im memofeld mit "mehr infos ausgegeben werden".
aber wie mach ich das,dass die infos NUR für das gewählte item angezeigt wird und nicht wie jetzt von allen feldern?


Dafür müsstest Du doch Deine Abfrage eigentlich nur so erweitern - oder?:
ausblenden SQL-Anweisung
1:
SELECT * FROM Tabelle1 WHERE DeinZuBestimmendesItem=ComboBox1.Value					

Wobei das "ComboBox1.Value" natürlich kein direkter SQL-Befehl mehr ist...
also schreibe ich Dir das dann noch mal so hin:
ausblenden Delphi-Quelltext
1:
ADOQuery1.SQL.Add('SELECT * FROM Tabelle1 WHERE DeinZuBestimmendesItem='+ComboBox1.Value);					
acnut Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 172
Erhaltene Danke: 3

Windows 7, Windows Vista, Windows XP, Ubuntu, Kubuntu, Pardus
Delphi 2010 SV, Java Editor, VS 2010 SV
BeitragVerfasst: Mo 01.02.10 20:42 
wie bekomm ich deinzubestimmendeswert?
so vllt?:
ausblenden Delphi-Quelltext
1:
ADOQuery1.SQL.Add[sql:1:c53c2e967e]('SELECT * FROM Tabelle1 WHERE ComboBox1.Items[ComboBox1.ItemIndex]='+combobox1.value)[/sql:1:c53c2e967e];					



mfg


Zuletzt bearbeitet von acnut am Di 02.02.10 10:45, insgesamt 1-mal bearbeitet
acnut Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 172
Erhaltene Danke: 3

Windows 7, Windows Vista, Windows XP, Ubuntu, Kubuntu, Pardus
Delphi 2010 SV, Java Editor, VS 2010 SV
BeitragVerfasst: Di 02.02.10 10:26 
HILFEE!!
acnut Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 172
Erhaltene Danke: 3

Windows 7, Windows Vista, Windows XP, Ubuntu, Kubuntu, Pardus
Delphi 2010 SV, Java Editor, VS 2010 SV
BeitragVerfasst: Di 02.02.10 11:05 
habs jetzt so gelöst :
ausblenden Delphi-Quelltext
1:
ADOQuery1.SQL.Add('SELECT * FROM Tabelle1 WHERE Homepage='+quotedstr(combobox1.items[combobox1.ItemIndex]));