M
majorsoft
Unregistered / Unconfirmed
GUEST, unregistred user!
用adotable不能修改数据??
procedure TForm1.editBtnClick(Sender: TObject);
begin
adotable1.Close;
adotable1.Open;
adotable1.last;
while adotable1.RecNo>7 do //从最后一条记录开始修改到第7条
begin
adotable1.Edit;
adotable1.Prior;
if adotable1.CanModify then
begin
adotable1.FieldByName('zd_id').Value:=
adotable1.FieldByName('zd_id').Value +1;
adotable1.Post;
end
else
showmessage('不在编辑或插入模式');
end;
adotable,Dbgrid,的readonly都是false
procedure TForm1.editBtnClick(Sender: TObject);
begin
adotable1.Close;
adotable1.Open;
adotable1.last;
while adotable1.RecNo>7 do //从最后一条记录开始修改到第7条
begin
adotable1.Edit;
adotable1.Prior;
if adotable1.CanModify then
begin
adotable1.FieldByName('zd_id').Value:=
adotable1.FieldByName('zd_id').Value +1;
adotable1.Post;
end
else
showmessage('不在编辑或插入模式');
end;
adotable,Dbgrid,的readonly都是false