您的位置:首页 > 其它

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

2013-01-18 11:01 871 查看
动态改变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()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: