Fakat rich editde alt satırlara geçince değişik karakterler gönderiyor doğal olarak veya yazının içinde tırnak işaretleri filan oluyor.
Bunlar oluncada doğal olarak sql kodum hata veriyor.
Yardımlarınızı bekliyorum. Kod şöyle
Kod: Tümünü seç
var
i:integer;
kullanicilar,kullanici,kimden:string;
konu,mesaj,mesajturu:string;
begin
kullanicilar:='';
konu:=edit1.Text;
mesaj:=RichEdit1.Text;
kimden:=frmana.Sql_LogoSatisElemanCODE.AsString;
mesajturu:='İç Mesaj';
for I := 0 to cxCheckComboBox1.Properties.Items.Count - 1 do
begin
if cxCheckComboBox1.States[i]= cbsChecked then kullanicilar:=kullanicilar+cxCheckComboBox1.Properties.Items[i].Description;
end;
for I := 0 to cxCheckComboBox1.Properties.Items.Count - 1 do
begin
if cxCheckComboBox1.States[i]= cbsChecked then
begin
kullanici:=cxCheckComboBox1.Properties.Items[i].Description;
sql_temp.SQL.Clear;
sql_temp.SQL.Add('INSERT INTO MESAJ_MERKEZI (KIMDEN,KIME,KONU,MESAJ,MESAJ_TURU,MESAJ_KUTUSU,ALINAN_MESAJ) VALUES');
sql_temp.SQL.Add('('''+kimden+''','''+kullanicilar+''','''+konu+''','''+mesaj+''','''+mesajturu+''','''+kullanici+''',1)'''); //hata gelen satır....
sql_temp.ExecSQL;
end;
end;