Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Di 21.06.05 09:46 
ausblenden Quelltext
1:
2:
sqlstatement := 'INSERT INTO Anwesenheit (MANR,DATUM,UHRZEITVON,UHRZEITBIS) ' +
                        'Values('s[0]','''+s[1]+''','''+s[2]+''','''+s[4]+''')';


ich habe das selbe statement mit normal 4 verschiedenen Variablen getestet, da ging es ohne probleme, nur kaum mache ich es mit einem Array kommt beim Kompilieren immer die Meldung operator oder Semikolon fehlt.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Di 21.06.05 10:01 
Zu wenig ' bei s[0].
Benutze lieber Format, das ist übersichtlicher:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Format ('INSERT INTO Anwesenheit (MANR,DATUM,UHRZEITVON,UHRZEITBIS) Values (%s,%s,%s,%s',
   [
    QuotedStr(s[0]), 
    QuotedStr(s[1]), 
    QuotedStr(s[3]), 
    QuotedStr(s[4]) 
   ]);
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Di 21.06.05 10:05 
nee, waren nicht zuwenig, bei einem ' wird ja nix angezeigt und bei ''' wird ' angezeigt. und die ' brauch ich ja nur bei Strings. hab grad ganz übersehen dass mir ein +s[0]+ gefehlt hat, also das plus.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Di 21.06.05 10:11 
Äh, stimmt auffallend. Nimm trotzdem Format. Ich musste mich auch erst dran gewöhnen, bringt aber viel.
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Di 21.06.05 10:32 
ok, ich schaus mir mal an, danke