Edit a record on a result dataset
Posted: Tue 28 Aug 2007 05:56
hi;
i have this code to change a field's value on a result dataset from a query:
Qcartas.First;
While not Qcartas.Eof do
begin
Qcartas.Edit;
Qcartas.FieldByName('re_record').AsString := 'S';
Qcartas.Post;
Qcartas.Next;
end;
But... there is a string field on the result dataset that sometimes contains a comma (,) so, i got an syntax error from the Mysql server.
That is because the update sentence generated by Qcartas.Post, uses all the fields on the where clause, so the one with the comma causes the error.
Is there a way to solve it or i have to rewrite the entire rutine?
TIA
i have this code to change a field's value on a result dataset from a query:
Qcartas.First;
While not Qcartas.Eof do
begin
Qcartas.Edit;
Qcartas.FieldByName('re_record').AsString := 'S';
Qcartas.Post;
Qcartas.Next;
end;
But... there is a string field on the result dataset that sometimes contains a comma (,) so, i got an syntax error from the Mysql server.
That is because the update sentence generated by Qcartas.Post, uses all the fields on the where clause, so the one with the comma causes the error.
Is there a way to solve it or i have to rewrite the entire rutine?
TIA