Request works fine when TitreEvenement doesn't contains "???"
Can someone help ?
here is the Sql.text
INSERT INTO evenements (idCalendriers,DebutEvenement,FinEvenement,TitreEvenement,Lieu,Description,idReservation,idbaptemes,idenmaintenance,idaeroclub) values(163,:debut,:fin,"(R) F-BFES xxx ???-LP","ici","du 04/08/2016 10:30:00\nau 04/08/2016 11:00:00\n--------------\n",1143,NULL,NULL,35)
Code: Select all
Q := CreateQuery;
try
Try
Q.Connection.StartTransaction;
Q.SQL.Text := SQL_INSERT + const_EVENEMENTS + ' (' //
+ const_EVENEMENTS_IDCALENDRIERS //
+ ',' + const_EVENEMENTS_DEBUTEVENEMENT //
+ ',' + const_EVENEMENTS_FINEVENEMENT //
+ ',' + const_EVENEMENTS_TITREEVENEMENT //
+ ',' + const_EVENEMENTS_LIEU //
+ ',' + const_EVENEMENTS_DESCRIPTION //
+ ',' + const_EVENEMENTS_IDRESERVATION //
+ ',' + const_EVENEMENTS_IDBAPTEMES //
+ ',' + const_EVENEMENTS_IDENMAINTENANCE //
+ ',' + const_EVENEMENTS_IDAEROCLUB //
+ ') values(' //
+ idCalendrier.ToSql //
+ ',:debut' //
+ ',:fin' //
+ ',' + Titre.ToSql //
+ ',' + Lieu.ToSql //
+ ',' + Description.ToSql //
+ ',' + idReservation.ToSqlNull //
+ ',' + idBapteme.ToSqlNull //
+ ',' + idEnMaintenance.ToSqlNull //
+ ',' + idaeroclub.ToSql //
+ ')'; //
Q.ParamByName('debut').AsDateTime := Debut;
Q.ParamByName('fin').AsDateTime := Fin;
Q.ExecSQL;
Result := Last_insert_id;
Q.Connection.Commit;
except
Q.Connection.Rollback;
raise;
End;