为什么更新不了我的数据库
dw_1.accepttext()
if isnull(dw_1.getitemstring(1,'c_name')) then
messagebox('警告','书名不能为空')
dw_1.setfocus()
dw_1.setcolumn('c_name')
return
end if
if isnull(dw_1.getitemstring(1,'c_writer')) then
messagebox('警告','作者')
dw_1.setfocus()
dw_1.setcolumn('c_writer')
return
end if
if isnull(dw_1.getitemstring(1,'c_publisher')) then
messagebox('警告','出版社')
dw_1.setfocus()
dw_1.setcolumn('c_publisher')
return
end if
long i
integer price
string id ,name,writer,publisher
id=dw_1.getitemstring(1,'c_id')
name=dw_1.getitemstring(1,'c_name')
price=dw_1.getitemnumber(1,'f_price')
writer=dw_1.getitemstring(1,'c_writer')
publisher=dw_1.getitemstring(1,'c_publisher')
if dw_1.update()=1 then
commit;
messagebox('恭喜','资料已经保存')
insert into t_books values(:id,:name,:price,:writer,:publisher,1)
commit;
else
rollback;
messagebox('错误','资料保存失败')
end if