Autor Beitrag
delphijanka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Di 13.10.09 19:28 
Hallo.

Wie kann ich '-Zeichen in die Datenbank speichern? Strings, die diese Zeichen enthalten, können nicht geschrieben werden, und die DB gibt ne Exception.

Danke für die Hilfe.
Apuch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 27

Kubuntu 9.04, Win 2000
Delphi 7
BeitragVerfasst: Di 13.10.09 19:34 
Probleme damit gibts nicht nur in Delphi. Hat damit zu tun, das der zugrunde liegende SQL-Code selbst Steuerzeichen hat.. wie eben ein '. Schau dir das hier mal an, das könnte was für dich sein.

MfG

_________________
DasLebenIstZuKurzFürWhitespaces!
delphijanka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151

WinXP
D 2009 Arc., Java, C
BeitragVerfasst: Di 13.10.09 21:50 
Die Funktion QuotedStr, deklariert in SysUtils, löst das problem. Danke.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 14.10.09 08:31 
Alternativ sollte man Parametrisierte Queries oder Prepared Statements liefern, dann wird das Encoding intern vorgenommen und man gewinnt zusätzlich an Performance, da man nur einmal das SQL-Statement compilen lassen muss.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.