2

I can not update rows in the database with the following instructions:

fdquery1.Edit;  
fdquery1.fieldByName('prova').AsString := 'asdasd';

fdquery1.Open;

Why? i must use another property of TFDQuery for changes to take effect

4

1 回答 1

6

TDataSet.Edit您必须调用TDataSet.Post以保留更改的值之后。

fdquery1.Edit;  
fdquery1.fieldByName('prova').AsString := 'asdasd';
fdquery1.Post;

文档也有一个示例

BTW:我不知道你为什么要再次打开数据集?

于 2014-06-14T00:20:32.180 回答