Autor Beitrag
stathis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Di 25.04.06 20:32 
Guten Tag wieder ein Problem
meine Code:

..
..
..
var
A,AA,B,BB,C,CC: real;
..
..
BB := ...
AA := ...
CC := ...
..
..
query3.Active := false;
query3.SQL.Clear;
query3.SQL.add('update table1 set A='+floattostr(AA)+',B='+floattostr(BB)+',C=''CC'' where (Panr='+panr+') and (pnr='+pnr+')');
query3.ExecSQL;

und mein Problem

wenn BB ein ganze Zahl ist dann ist alles in Ordnung wenn aber BB ein real Zahl ist (z.B 20,5 ) dann bekomme folgende Fehler:
invalid use of keyword...
0xCC
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 150



BeitragVerfasst: Di 25.04.06 20:36 
dann solltest du den float wohl in anführungstriche setzen, entweder ' oder "
z.b.
ausblenden Delphi-Quelltext
1:
query3.SQL.add('update table1 set A='+quotedstr(floattostr(AA))+',B='+ ...					
stathis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Di 25.04.06 20:45 
user profile icon0xCC hat folgendes geschrieben:
dann solltest du den float wohl in anführungstriche setzen, entweder ' oder "
z.b.
ausblenden Delphi-Quelltext
1:
query3.SQL.add('update table1 set A='+quotedstr(floattostr(AA))+',B='+ ...					


hallo danke für die schnelle Antwort.
Das habe ich probiert und bekomme folgende Fehler Meldung: Type mismatsch in expression .
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 25.04.06 20:48 
Versuch mal mit Ändern des Dezimaltrenners:
ausblenden Delphi-Quelltext
1:
DecimalSeparator := '.';					

_________________
Markus Kinzler.
stathis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Di 25.04.06 20:59 
user profile iconmkinzler hat folgendes geschrieben:
Versuch mal mit Ändern des Dezimaltrenners:
ausblenden Delphi-Quelltext
1:
DecimalSeparator := '.';					


Es hat funktioniert.

Ich danke alle