动态改变DataWindow控件窗口中内容的几种实现方法

动态改变DataWindow控件窗口中内容的几种实现方法(适合初学者)(网友 lingyun)


网友:lingyun Email: marine@yanan.xmu.edu.cn

在程序运行过程中,要动态的改变DataWindow控件窗口中内容的可用多种方法实现:
1.创建多个DataWindow对象,在程序运行时,通过一按钮控件的Click事件来改变DataWindow对象
if dw_control.dataobject=d_object1 then
dw_control.dataobject=d_object2
else
dw_control.dataobject=d_object1
end if
dw_control.settransobject(SQLCA)
dw_control.retrieve()
2.使用setsqlselect函数
dw_control.setsqlselect("select * from table1")
dw_control.retrieve()
3.使用modify函数
dw_control.modify("datawinodw.table.select='select * from table1'")
4.使用create(syntax{,errorbuffer})函数
syntax有三种方法实现:
调用libraryexport()
调用syntaxfromsql()
用户自定义
如:
string ls_select,ls_present
ls_select="select * from table1 where name like 'l%'"
ls_present="style(type=form)"
ls_syntax=SQLCA.syntaxfromsql(ls_select,ls_present)
dw_control.create(ls_syntax)
dw_control.settransobject(SQLCA)
dw_control.retrieve()
5.或者自己动态创建一个DataWindow控件
打开new user boject 对话框,创建一标准DataWindow类用户对象
根据需要对控件增加功能,并保存到用户库中
在程序中调用函数:openuserobject(userobjectvar{,x,y})
窗口关闭前清除对象:closeuserobject() 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值