祝愿大家身体健康!

 站点注册  找回密码
 站点注册

QQ登录

只需一步,快速开始

查看: 6535|回复: 3

[PB9.X以前] 关于参数传递到DW问题

[复制链接]

[PB9.X以前] 关于参数传递到DW问题

[复制链接]
bigfrog

主题

0

回帖

2179

积分

金牌会员

积分
2179
贡献
在线时间
小时
2015-3-3 22:06:09 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?站点注册

×
普通窗口如图查询按钮的代码如下:

string li_no
li_no=sle_100.text
openwithparm(w_em_modi,li_no) //传递字符型数据


w_em_modi的open事件代码为
dw_1.settransobject(sqlca)
string li_no
li_no=message.stringparm //接受字符
以下是老大那偷的:)
dw_1.setfilter("姓名 =li_no")//查询条件  
dw_1.filter()//过滤
dw_1.retrieve() //执行在数据窗口显示

出现以下错误

难道参数传递不能到DW吗?
普通窗口可以的
是什么问题





查询.jpg
问题.jpg
共享共进共赢Sharing And Win-win Results
SYBASEBBS - 免责申明1、欢迎访问“SYBASEBBS.COM”,本文内容及相关资源来源于网络,版权归版权方所有!本站原创内容版权归本站所有,请勿转载!
2、本文内容仅代表作者观点,不代表本站立场,作者自负,本站资源仅供学习研究,请勿非法使用,否则后果自负!请下载后24小时内删除!
3、本文内容,包括但不限于源码、文字、图片等,仅供参考。本站不对其安全性,正确性等作出保证。但本站会尽量审核会员发表的内容。
4、如本帖侵犯到任何版权问题,请立即告知本站 ,本站将及时删除并致以最深的歉意!客服邮箱:admin@sybasebbs.com
ehxz

主题

0

回帖

57万

积分

管理员

积分
570784
贡献
在线时间
小时
2015-3-3 22:29:14 | 显示全部楼层
dw_1.setfilter("姓名 =li_no")//查询条件
上面这行有问题,请仔细看一下PB自带的帮助,注意相关的语法。

PowerBuilder   This statement defines the filter expression for dw_Employee as the value of format1:

dw_Employee.SetFilter(format1)

The following statements define a filter expression and set it as the filter for dw_Employee. With this filter, only those rows in which the cust_qty column exceeds 100 and the cust_code column exceeds 30 are displayed. The final statement calls Filter to apply the filter:

string DWfilter2

DWfilter2 = "cust_qty > 100 and cust_code >30"

dw_Employee.SetFilter(DWfilter2)

dw_Employee.Filter( )

The following statements define a filter so that emp_state of dw_Employee displays only if it is equal to the value of var1 (in this case ME for Maine). The filter expression passed to SetFilter is emp_state = ME:

string Var1

Var1 = "ME"

dw_Employee.SetFilter("emp_state = '"+ var1 +" '")

The following statements define a filter so that column 1 must equal the value in min_qty and column 2 must equal the value in max_qty to pass the filter. The resulting filter expression is:

#1=100 and #2=1000

The sample code is:

integer max_qty, min_qty

min_qty = 100

max_qty = 1000

dw_inv.SetFilter("#1="+ String( min_qty) &

        + " and #2=" + String(max_qty))

The following example sets the filter expression to null, which causes PowerBuilder to display the Specify Filter dialog box. Then it calls Filter, which applies the filter expression the user specified:

string null_str

SetNull(null_str)

dw_main.SetFilter(null_str)

dw_main.Filter()
共享共进共赢Sharing And Win-win Results
bigfrog 楼主

主题

0

回帖

2179

积分

金牌会员

积分
2179
贡献
在线时间
小时
2015-3-4 17:44:44 | 显示全部楼层
明白了,谢谢大大
我理解错了格式
不过,很奇怪,也能通过编译
共享共进共赢Sharing And Win-win Results
ehxz

主题

0

回帖

57万

积分

管理员

积分
570784
贡献
在线时间
小时
2015-3-4 18:29:22 | 显示全部楼层
PB的帮助还是很好的,有些要好好看。编译通过的,不一定就肯定没问题。所有的代码都可能这样。
多看一些别人写的,慢慢就学会好。PB上手还是快的很的。
共享共进共赢Sharing And Win-win Results
您需要登录后才可以回帖 登录 | 站点注册

本版积分规则

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com

QQ|Archiver|PowerBuilder(PB)BBS社区 ( 鲁ICP备2021027222号-1 )

GMT+8, 2024-4-29 05:02 , Processed in 0.438496 second(s), 10 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表