注册 登录
编程论坛 PowerBuilder

为什么出这个错?

coneth 发布于 2007-04-19 15:32, 1407 次点击

只有本站会员才能查看附件,请 登录

老是出现这个错误,应该怎么改啊??
string ls_sql
boolean lb_hasAnd=false
ls_sql= "SELECT ~"员工编号~",~"姓名~",~"部门号~",~"部门名称~",~"职位号~", "+&
" ~"职位名称~",~"性别~",~"出生日期~",~"籍贯~",~"民族~",~"身份证号~", "+&
" ~"最高学历~",~"专业~",~"婚姻状况~",~"参加工作时间~",~"住址~",~"手机~", "+&
" ~"宅电~",~"电子邮件~",~"备注~" FROM ~"bascinfo~" "

if not trim(w_op.em_1.text)=" " or not trim(w_op,sle_1.text)=" " or &
not trim(w_op.ddlb_1.text)=" " or not trim(w_op.ddlb_2.text)=" " or &
not trim(w_op.ddlb_3.text)=" " or &
not trim(w_op.sle_2.text)=" " then
ls_sql=ls_sql+" where "
end if
if not trim(w_op.em_1.text)=" " then
ls_sql=ls_sql+" ~"员工编号~" = "+&
w_op.em_1.text
lb_hasAnd=true
end if
if not trim(w_op.sle_1.text)=" " then
if lb_hasAnd then
ls_sql=ls_sql+" and "
end if
ls_sql=ls_sql+" ~"姓名~" = ~'"+w_op.sle_1.text+"~' "
lb_hasAnd=true
end if
if not trim(w_op.ddlb_1.text)=" " then
if lb_hasAnd then
ls_sql=ls_sql+" and "
end if
ls_sql=ls_sql+" ~"部门名称~" = ~'"+w_op.ddlb_1.text+"~' "
lb_hasAnd=true
end if
if not trim(w_op.ddlb_2.text)=" " then
if lb_hasAnd then
ls_sql=ls_sql+" and "
end if
ls_sql=ls_sql+" ~"职位名称~" = ~'"+w_op.ddlb_2.text+"~' "
lb_hasAnd=true
end if
if not trim(w_op.ddlb_3.text)=" " then
if lb_hasAnd then
ls_sql=ls_sql+" and "
end if
ls_sql=ls_sql+" ~"最高学历~" = ~'"+w_op.ddlb_3.text+"~' "
lb_hasAnd=true
end if
if not trim(w_op.sle_2.text)=" " then
if lb_hasAnd then
ls_sql=ls_sql+" and "
end if
ls_sql=ls_sql+" ~"专业~" = ~'"+w_op.sle_2.text+"~' "
lb_hasAnd=true
end if
dw_1.settrans(sqlca)
dw_1.setsqlselect(ls_sql)
dw_1.retrieve()
if dw_1.rowcount()=0 then
messagebox("提示!","没有符合条件的人员!")
end if

4 回复
#2
hzjwcx2007-04-20 14:38
dw_1.settrans(sqlca)這句是不是有問題:dw_1.settransobject(sqlca)
你的if條件有問題,看看是不是那個有錯
#3
huiling2007-04-20 15:10
error c0052提示的是trim 函数的参数错误,只要把错误的参数改正下面的那个问题就没有了。

or not trim(w_op,sle_1.text)=" "
把逗号改成点“.”
or not trim(w_op.sle_1.text)=" "
#4
coneth2007-04-24 16:32

呵呵~谢谢~~问题解决了~

1