Autor Beitrag
Shaky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

WinXP
D5, Delphi 2005 Prof.
BeitragVerfasst: Do 24.03.05 08:30 
Hi ist es möglich das ich ne Datenbank Abfrage machen z.b

ausblenden Quelltext
1:
Select nummer,art from Telefon where USER_ID=2					


und dann mit einer WHile schleife jeweils ein Label und ein Edit erstelle, in welchen dann halt der Inhalt drin steht

label: (art) (privat 1)
Edit: Nummer (55514986)

label: (art) (privat 2)
Edit: Nummer (55598560)

label: (art) (Handy)
Edit: Nummer (01759665582215)

Dankeschön

Moderiert von user profile iconChristian S.: Code-Tags hinzugefügt.
raiha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: Do 24.03.05 08:42 
Sicher geht das aber ich denke du bist mit den DB Komponeten DataSource und DBGrid schneller und besser dran. Da kann man sich recht eifach auf die DB und ihre Tabellen hängen.

Tschüss Rainer
Shaky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

WinXP
D5, Delphi 2005 Prof.
BeitragVerfasst: Do 24.03.05 08:52 
Ja mit nem DB Grid hab ich das ja bisher. Finde das aber 1. nicht so schön und will ja evtl. noch bedigungen mit den Werten machen.

Also wenn du weiß wie dann sag es mir bitte!

Danke
raiha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: Do 24.03.05 09:00 
gut, gut - wusste ich ja nicht ;-)

würde dann ein dataset machen was ich entsprechend mit select und update belege wie du es gerade brauchst.

man kann da ja
ausblenden Delphi-Quelltext
1:
2:
3:
              SelectSQL.Clear;
              SelectSQL.Add('Select * from Tab Where Nr = '+IntToStr(NR));
              Open;

bei den Querys auch im Quelltext ansprechen. Genauso geht das auch mit Update und Co. für deine Änderungswünsche.

Das alles in eine Schleife rein - und dann wie dus Dir dachtest


denke ich :-)

Tschüss Rainer

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Shaky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

WinXP
D5, Delphi 2005 Prof.
BeitragVerfasst: Do 24.03.05 09:10 
Mmh nett. Aber du hast mein Problem nicht ganz verstanden.

Also an der DB Anbindung den SQL Abfragen scheitert es nciht.

Es scheitert an dem dynamischen aufbau.

Also im normalfall ist dan nur name, vorname, usw. zu sehen.
aber fall zu dem jenigen in der Datenbank Telefon noch einträge soll er je nach anzahl der Datensätze die Labels und Edits erstelln.

Aber wir erstelle ich diese per Code.
Ich könnte natür schon 5 reinmachen alle auf invisible und dann halt nach einander auf true setzten. aber das muss doch auch schöner gehen, oder?

Trotzdem danke!
raiha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: Do 24.03.05 09:18 
Shaky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

WinXP
D5, Delphi 2005 Prof.
BeitragVerfasst: Do 24.03.05 09:45 
Jo Dankeschön.

Das tuts. Jetzt muss ich noch ein bisschen tüfteln aber das wird schon