运行时弹出的窗口错误如下:
Row changed between retrieve and update.
No changes made to database.
UPDATE "book" SET "flag" = ? WHERE "flag" = ? AND "bookid" = ? AND "bookname" = ? AND "borrowdate" = ? AND "returndate" IS NULL
原代码如下:
int i,flag,rc
date returndate
string selname
returndate=today()
for i=1 to dw_1.getRow()
flag=dw_1.getItemNumber(i,"flag")
if flag=0 then
rc++
selname=dw_1.GetItemString(i,"bookid")
update "book"
set "book".returndate=:returndate,
"book".borrowdate=NULL,
"book".borrowname=Null
where "book".bookid=:selname
using sqlca;
// dw_1.update()
if dw_1.update()=1 then
commit;
messagebox('提示信息:',"归还图书操作成功!")
else
rollback;
messagebox('提示信息:',"归还图书操作失败!")
end if
end if
next if rc=0 then
messagebox("提示:","您好! 请点击您要还的书")
return 1
end if
dw_1.retrieve()
[此贴子已经被作者于2006-6-12 18:52:54编辑过]