update proerties 已经设置了要更新的表及字段
流程是:查询后再修改dw字段的值,提示出错(如果我把sql=“”去掉,直接dw_1.retrieve();,
修改数据后再保存是可以滴,如果数据源是 select a.rkbh,a.goodsid,a.goodsqty,a.ph,a.zhj,
a.bumenid from zp_goods_rkmx a
且 sql="select a.rkbh,a.goodsid,a.goodsqty,
a.ph,a.zhj,a.bumenid from zp_goods_rkmx a where ("+ls_filter+")"" 也是可以保存)
查询按钮的代码:
string ls_filter,sql,ls_flag
ls_filter="a.rkbh ="+sle_1.text
dw_1.settransobject(sqlca);
sql="select b.goodsname,a.rkbh,a.goodsid,"&
+"a.goodsqty,a.ph,a.zhj,a.bumenid "&
+"from zp_goods_rkmx a,zp_goods b where "&
+"a.goodsid=b.goodsid and ("+ls_filter+")"
dw_1.setsqlselect(sql)
dw_1.retrieve();
sle_1.text=''
sle_1.setfocus()
------解决方案--------------------
你的setsqlselect更改了数据源,所以导致更新属性换了,
你查下setsqlselect前后的.Describe("DataWindow.Table.UpdateTable")就知道了;
如果你一定要这样检索,可以通过Modify方法在setsqlselect后再设置一下更新属性,网上有很多类似代码~~