我通过StringGrid修改ADODataSet中的数据,下面是代码:
procedure TfrmGroupList.grdGroupListSetEditText(Sender: TObject; ACol,
ARow: Integer; const Value: String);
var
i: Integer;
begin
i := 0;
ADSGroupList.First;
while i < (ARow - 1) do
begin
ADSGroupList.Next;
Inc(i);
end;
ADSGroupList.Edit;
ADSGroupList.Fields[ACol].Value := grdGroupList.Cells[ACol,ARow];
end;总是报Field "XXX" can not be modified.
谁能告诉我为什么?谢谢。
procedure TfrmGroupList.grdGroupListSetEditText(Sender: TObject; ACol,
ARow: Integer; const Value: String);
var
i: Integer;
begin
i := 0;
ADSGroupList.First;
while i < (ARow - 1) do
begin
ADSGroupList.Next;
Inc(i);
end;
ADSGroupList.Edit;
ADSGroupList.Fields[ACol].Value := grdGroupList.Cells[ACol,ARow];
end;总是报Field "XXX" can not be modified.
谁能告诉我为什么?谢谢。
解决方案 »
- 帮写个全局hook,屏蔽按键消息和鼠标消息,热键退出?
- 多用户数据库更新问题,DataSetProvider.ApplyUpdates时出错,"Record not found or changed by other user"
- 公司招聘以下人员(两名)
- 跪求大虾解释如下pc与ic卡通信协议
- 请教串口编程问题!
- 如何在程序中,将printersetup 选中的打印机设置为操作系统的缺省打印机?
- 菜鸟级问题—>怎么把所有help集成在一起啊?
- 反对封锁google的请跟贴!!!
- 为什么反斜杠是"\",斜杠是"/"????
- 一个很怪异的问题
- 谁有delphi6.0 函数详解?
- query控件,这样的查询应该怎么做?
ARow: Integer; const Value: String);
var
i: Integer;
begin
i := 0; ADSGroupList.Edit; //位置改变 ADSGroupList.First;
while i < (ARow - 1) do
begin
ADSGroupList.Next;
Inc(i);
end;
//ADSGroupList.Edit;
ADSGroupList.Fields[ACol].Value := grdGroupList.Cells[ACol,ARow];
end;