Autor Beitrag
maze2k
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Do 16.10.03 17:56 
Ich hab eine MySQL Komponente (TMySQL) ein paar TEdits, TMemos und ne TComboBox und folgenden Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
  sql.Utility.PrepareSelectDatabase('chatserver','Zugriff auf Datenbank');
  sql.Query.Prepare(PChar('update chatuser set alter = ' + alter.Text + ' where uid = ' + uid), 'Profil sichern');
  sql.Query.Prepare(PChar('update chatuser set sternzeichen = ' + IntToStr(Sternzeichen.Itemindex) + ' where uid = ' + uid), 'Profil sichern');
  sql.Query.Prepare(PChar('update chatuser set hobbies = ' + Hobbies.Text + ' where uid = ' + uid), 'Profil sichern');
  sql.Query.Prepare(PChar('update chatuser set wohnort = ' + Wohnort.Text + ' where uid = ' + uid), 'Profil sichern');
  sql.Query.Prepare(PChar('update chatuser set homepage = ' + Homepage.Text + ' where uid = ' + uid), 'Profil sichern');
  sql.Query.Prepare(PChar('update chatuser set email = ' + Email.Text + ' where uid = ' + uid), 'Profil sichern');
  sql.Execute;
  sql.Close;


Das is ein Profil-Update-Script aus meinem Chat...

Aber leider funktioniert das nicht...
geupdated wird nur das Sternzeichen, also nur der Text aus der Combobox....

Warum?
In den Edits bzw. Memos steht Text, das is sicher (hab ich auch mit Showmessage getestet...

Aber es wird nicht in die Datenbank geschrieben... das Sternzeichen schon.. komisch ist das!

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)
maze2k Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Do 16.10.03 18:38 
Kann mir denn keiner helfen?
Ich bekomm's irgendwie net hin! :nixweiss:

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)
Horst
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Do 16.10.03 19:14 
hallo,

wieso machst du es mit prepare :?:
warum legst du nicht einfach einen sql-Stringlist an und machst dann ein execute :?: könnte dann wie folgt aussehen:

ausblenden Quelltext
1:
2:
3:
4:
  query1.sql.clear;
  query1.sql.add('update chatuser set email = "' + Email.Text + '" where uid = ' + uid); 
  query1.Execute; 
  query1.Close;


Texte müssen mit Hochkomma eingegrenzt werden. Falls deine uid auch ein string ist, muss du die hochkommatas noch ergänzen.
Mit der syntax funktioniert es bei mir zumindestens.
Hoffe bei dir jetzt auch :lol:

Gruß

Horst
:wave:
maze2k Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Do 16.10.03 19:45 
Die funktion query1.sql.add gibts bei mir nicht :-/

Wir haben wohl unterschiedliche Komponenten...

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)
maze2k Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Do 16.10.03 19:53 
Auch das mit den Hochkommas funktioniert nicht (Bei Prepare)...

Muss wohl an was anderem liegen...

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)