求助!急!急!急!急!急!
我在更改DBGrid的显示顺序时总是出错,说“无法为更新定位行,一些值可能已在最一次读取后更改。”
我的部分程序在下面
m1.gh:=AdoTable2.FieldValues['工号'];
m1.sex:=AdoTable2.FieldValues['性别'];
m1.zt:=AdoTable2.FieldValues['工作状态'];
m1.isYuYue:=AdoTable2.FieldByName('是否有约').AsBoolean;
//读出需要上移的序号得上一条内的员工信息(15)
AdoTable2.Prior;
m2.gh:=AdoTable2.FieldValues['工号'];
m2.sex:=AdoTable2.FieldValues['性别'];
m2.zt:=AdoTable2.FieldValues['工作状态'];
m2.isYuYue:=AdoTable2.FieldByName('是否有约').AsBoolean;
AdoTable2.Edit;
AdoTable2.FieldByName('工号').AsInteger:=m1.gh;
AdoTable2.FieldByName('性别').AsString:=m1.sex;
AdoTable2.FieldByName('工作状态').AsInteger:=m1.zt;
AdoTable2.FieldByName('是否有约').AsBoolean:=m1.isYuYue;
// AdoTable2.Post;
// AdoTable2.FieldValues['序号']:=m0.gh-1;
AdoTable2.Next;
AdoTable2.Edit;
AdoTable2.FieldByName('工号').AsInteger:=m2.gh;
AdoTable2.FieldByName('性别').AsString:=m2.sex;
AdoTable2.FieldByName('工作状态').AsInteger:=m2.zt;
AdoTable2.FieldByName('是否有约').AsBoolean:=m2.isYuYue;
AdoTable2.Post;