数据窗口如何修改UPDATE属性?

bombshell 2013-08-08 07:32:30
数据窗口通过代码动态修改了SQL , 代码如下:


ls_sql = dw_2.describe("datawindow.table.select")
if posa(ls_sql , "where") > 0 then
ls_select = lefta(ls_sql , posa(ls_sql , "where") -1)
else
ls_select = ls_sql
end if
ls_where = "where a.flid ='"+gs_flid+"' and a.ifenddate = 0"
ls_sql = ls_select+ls_where


可修改后该数据窗口就不能删除,如下图窗口:


请问各位网友如何修改呢?
...全文
253 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
镜鉴惊境 2013-08-09
  • 打赏
  • 举报
回复
没有主键吧,没有主键选择不了可更新的列
bombshell 2013-08-09
  • 打赏
  • 举报
回复
感谢版主,我的QQ: 2736952507
WorldMobile 2013-08-08
  • 打赏
  • 举报
回复
你的QQ号,给你远程看一下
bombshell 2013-08-08
  • 打赏
  • 举报
回复
还是提示:
WorldMobile 2013-08-08
  • 打赏
  • 举报
回复
引用 3 楼 bombshell 的回复:
还是不行呀,字段xh是自增的。
现在是什么提示? 如果是自增加,还需要 dw_2.modify("xh.Identity='yes'")
bombshell 2013-08-08
  • 打赏
  • 举报
回复

ls_sql = dw_2.describe("datawindow.table.select")
   if posa(ls_sql , "where") > 0 then
	   ls_select = lefta(ls_sql , posa(ls_sql , "where") -1)
   else
	   ls_select = ls_sql
   end if
	ls_where = "where a.flid ='"+gs_flid+"' and a.ifenddate = 0"
   ls_sql = ls_select+ls_where
   if dw_2.setsqlselect(ls_sql) = 1 then
      dw_2.modify("datawindow.table.updatetable = dangan") 
      dw_2.modify("xh.update = yes") 
      dw_2.modify("dang_mj.update = yes") 
      dw_2.modify("wjgh.update = yes") 
      dw_2.modify("dangxh.update = yes") 
      dw_2.modify("dangmc.update = yes")
      dw_2.modify("fs.update = yes")
      dw_2.modify("dangan_dzwj.update = yes")
      dw_2.modify("xh.key = yes") 
      ll_rowcount = dw_2.retrieve()
      if ll_rowcount > 0  then
	 cb_2.enabled = true
	 cb_3.enabled = true
	 cb_4.enabled = true
	 cb_5.enabled = true
      end if
   end if
end if
还是不行呀,字段xh是自增的。
bombshell 2013-08-08
  • 打赏
  • 举报
回复
呵呵,我也找到了这段代码,谢谢! 试一下!
WorldMobile 2013-08-08
  • 打赏
  • 举报
回复
参考以下代码,首先设置更新的表,然后设置更新列 //设置Employee表成为新的可修改表  dw_1.Modify( DataWindow.Table.UpdateTable =  employee  ) dw_1.Modify( employee_emp_id.Update =  Yes  )  dw_1.Modify( employee_emp_fname.Update =  Yes  )  dw_1.Modify( employee_emp_lname.Update =  Yes  )  dw_1.Modify( employee_emp_id.Key =  Yes  ) 

740

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 脚本语言
社区管理员
  • 脚本语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧