![]() |
ZeosDbo - Updatebefehl - Fehler bei WHERE?!
Hallo!
Bekomme eine Fehlermeldung bei WHERE bei folgenden Befehlen:
Delphi-Quellcode:
Hat jemand eine Ahnung?
id := 1;
prize1 := strtofloat(txt_0_1.text); prize2 := strtofloat(txt_1_1.text); prize3 := strtofloat(txt_2_1.text); frmmain.qu.SQL.Text:='UPDATE `prize` Set `prize1`=''prize1'','+ '`prize2`=''prize2'','+ '`prize3`=''prize3'','+ 'WHERE `id`=''id'';'; frmmain.qu.ExecSql; Vielen Dank im voraus! Gruß 1PM exakte Fehlermeldung : Project1.exe raised exception class EDatabaseError with message 'qu: You have an error in your SQL syntax near 'WHERE `id`='id'' at line 1'. Process stopped. |
Hiho
Ich glaube du musst die ` durch ' <-Hochstriche ersetzen in diesem fall musst du doppelte Hochstriche benutzen damit Delphi einen macht |
Das mit den Strichen ist schon richtig so wie ich es gemacht habe! Wenn ich Updaten will, bringt er mir diese Fehlermeldung!
TRotzdem Danke für deine Hilfe! Gruß 1PM |
Hallo, ich versuch mich mal.
Zitat:
2. So wie du das schreibst setzt er die prize-Felder auf den String 'prize1' etc. Könntest du vielleicht folgendes wollen:
Delphi-Quellcode:
Chris
id := 1;
prize1 := strtofloat(txt_0_1.text); prize2 := strtofloat(txt_1_1.text); prize3 := strtofloat(txt_2_1.text); frmmain.qu.SQL.Text:='UPDATE prize Set '+ 'prize1 ='+FormatFloat('0,00', prize1)+ ', prize2 ='+FormatFloat('0,00', prize2)+ ', prize3 ='+FormatFloat('0,00', prize3)+ ' WHERE id='IntToStr(id); frmmain.qu.ExecSql; |
Vielen Dank Chris! Hat super funktioniert! :hello: :hello: :hello:
Gruß 1PM |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:26 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz