Ich benutze die
Zeoslibs, um mit meinem
MySQL-Server zu kommunizieren. Ich kann auch einwandfrei eine neue Tabelle anlegen, dorthinein schreiben und auch updaten, aber wenn ich den Inhalt der Tabelle in einer
ListView ausgeben will, bekomme ich einen
EStackOverflow.
Das hier ist mein Quellcode für das schreiben in die ListView:
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:
| procedure TForm1.Btn_ZeigenClick(Sender: TObject); var ListItem: TListItem; begin dbMain.Host := Edt_Server.Text; dbMain.Login := Edt_User.Text; dbMain.Password := Edt_Passwort.Text; dbMain.Database := Edt_Datenbank.Text; dbMain.Connected := true;
try qrMain.Sql.Text := 'SELECT * FROM `adressbuch` order by nachname;'; qrMain.Open;
qrMain.FieldByName('id').AsString;
while not qrMain.Eof do begin ListItem := ListView1.Items.Add; ListItem.Caption := qrMain.FieldByName('id').AsString; ListItem.SubItems.Add(qrMain.FieldByName('vorname').AsString); ListItem.SubItems.Add(qrMain.FieldByName('nachname').AsString); ListItem.SubItems.Add(qrMain.FieldByName('adresse').AsString); ListItem.SubItems.Add(qrMain.FieldByName('plz').AsString); ListItem.SubItems.Add(qrMain.FieldByName('wohnort').AsString); qrMain.Next; end; finally dbMain.Connected := false; end; end; |
Kann mir jemand sagen, wo mein Fehler liegt?
There are only 10 types of people: those who understand binary and those who don't.