数据窗口添加的问题!!!!(急急急)在线等待!
我有一个free模式的数据窗口。
有两个按钮:添加,保存
添加按钮代码:
long gc_ls
tab_1.tabpage_2.dw_gc_in_pubinfo.retrieve("")
tab_1.tabpage_2.dw_gc_in_pubinfo.settransobject(sqlca)
tab_1.tabpage_2.dw_gc_in_pubinfo.insertrow(0)
gc_ls = tab_1.tabpage_2.dw_gc_in_pubinfo.getrow()
tab_1.tabpage_2.dw_gc_in_pubinfo.scrolltorow(gc_ls)
tab_1.tabpage_2.dw_gc_in_pubinfo.setrow(gc_ls)
tab_1.tabpage_2.dw_gc_in_pubinfo.setfocus()
保存按钮代码:
tab_1.tabpage_2.dw_gc_in_pubinfo.settransobject(sqlca)
tab_1.tabpage_2.dw_gc_in_pubinfo.update()
if sqlca.sqlcode<>0 then
rollback;
messagebox("错误","添加失败!")
return
end if
commit;
messagebox("提示","添加成功")
问题是:第一次点添加按钮,添加完成后,保存会出现添加失败。
但是第二次点添加按钮完成后保存就会正常!
实在是不知道有什么问题,请高人指点!!!(急急急)