Autor |
Beitrag |
jjturbo
Beiträge: 516
Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
|
Verfasst: Di 20.10.15 09:01
Moiun Forum,
ich habe hier eine Konstellation aus MySQL Datenbank, ZConnection, ZQuery, DBGrid.
1:Ich ändere in einer Zeile ein Feld, springe mit TAB weiter, ändere ein zweites Feld.
Cursor down.
2: Ich ändere wieder ein Feld. Cursor down, Cursor up, TAB zum nächsten Feld, ändere es, Cursor down.
3: Noch mal wie bei 1.
Wenn ich jetzt ein Refresh auf mein ZQuery mache, dann sehe ich das das zweite in [2] geänderte Feld nicht übernommen wurde. Kann mir jemand erklären was ich falsch mache?
Dank Euch, Gruß Oliver
_________________ Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
|
|
baumina
Beiträge: 305
Erhaltene Danke: 61
Win 7
Delphi 10.2 Tokyo Enterprise
|
Verfasst: Di 20.10.15 09:22
Um den Fehler näher einzugrenzen, kontrolliere die Feldinhalte z.B. in den Query-Ereignissen BeforePost und AfterPost.
|
|
jjturbo
Beiträge: 516
Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
|
Verfasst: Di 20.10.15 09:39
Wenn ich die Felder in BeforePost und AfterPost abfrage stehen schon die neu eingetragenen Werte drin.
_________________ Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
|
|
baumina
Beiträge: 305
Erhaltene Danke: 61
Win 7
Delphi 10.2 Tokyo Enterprise
|
Verfasst: Di 20.10.15 09:49
Aber in der Datenbank wurden die Felder nur teilweise geändert?
|
|
jjturbo
Beiträge: 516
Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
|
Verfasst: Di 20.10.15 09:50
Ja, in diesem Beispiel habe ich ca. 20 Felder, 9 und 11 werden geändert.
Aber nach dem Refresh ist wie oben in [2] beschrieben der zweite Wert nicht übernommen worden.
_________________ Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
|
|
baumina
Beiträge: 305
Erhaltene Danke: 61
Win 7
Delphi 10.2 Tokyo Enterprise
|
Verfasst: Di 20.10.15 09:56
Meine Frage war nach der Datenbank (zu kontrollieren mit z.B. MySQL Query Browser). Vielleicht stimmt ja der Datentyp mit den Daten nicht überein.
|
|
jjturbo
Beiträge: 516
Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
|
Verfasst: Di 20.10.15 10:07
Im MySQL Workbench sehe ich das gleiche wie in meinen DBGrid wenn ich das entsprechende Statement absetze.
_________________ Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
|
|
baumina
Beiträge: 305
Erhaltene Danke: 61
Win 7
Delphi 10.2 Tokyo Enterprise
|
Verfasst: Di 20.10.15 10:15
Aber innerhalb der Workbench kannst du den Feldinhalt auf den Wert setzen?
|
|
Sinspin
Beiträge: 1327
Erhaltene Danke: 117
Win 10
RIO, CE, Lazarus
|
Verfasst: Di 20.10.15 12:05
Stelle sicher das vor den ausführen von Refresh der aktuelle Datensatz gepostet wird. Solltest Du Refresh ausführen solange ein Datensatz noch nicht abgesendet ist wird der verworfen.
Sollte es das nicht sein, hast Du an irgendwelchen Eingabefeldern / Gridfeldern die Aktionen ausführen wenn ein Feld geändert wird? Oder bevor der Datensatz gepostet wird? Eventuell führt so etwas en Refesh aus und verwirft damit deine Eingaben.
_________________ Wir zerstören die Natur und Wälder der Erde. Wir töten wilde Tiere für Trophäen. Wir produzieren Lebewesen als Massenware um sie nach wenigen Monaten zu töten. Warum sollte unser aller Mutter, die Natur, nicht die gleichen Rechte haben?
|
|
mandras
Beiträge: 430
Erhaltene Danke: 107
Win 10
Delphi 6 Prof, Delphi 10.4 Prof
|
Verfasst: Di 20.10.15 20:13
Sinspin hat folgendes geschrieben : | Solltest Du Refresh ausführen solange ein Datensatz noch nicht abgesendet ist wird der verworfen. |
Durch das Cursor up/down wird normalerweise automatisch gepostet.
Transaktionen vermute ich auch nicht als Fehlerquelle da es sich um MySQL handelt.
Vielleicht hilft die ZSQLMonitor-Komponente weiter.
Oder Zeos kann aus der Query kein korrektes Update-Statement erstellen (würde man auch mit ZSQLMonitor finden)
- für diesen Fall einmal mit ZUpdateSQL arbeiten
|
|