注册 登录
编程论坛 SQL Server论坛

在pb中使用SETFILTER进行两个条件以上筛选总报错

linzhonglin 发布于 2011-02-26 12:23, 1059 次点击
string ls_condition1
string ls_condition2
string ls_condition

ls_condition1="sfsc='1'"
ls_condition2="upper(jxbh) like '%"+upper(sle_1.text)+"%'"
if ls_condition2='' then
    if ls_condition1<>'' then
        ls_condition=ls_condition1
    end if
else
    if ls_condition1<>'' then
        ls_condition=ls_condition1+ ' and '+ls_condition2
    else
        ls_condition=ls_condition2
    end if
   
end if
//ls_condition=string(ls_condition)
messagebox(' ',ls_condition)
dw_1.setfilter(ls_condition)
报错EXPRESS IS NOT VALID
4 回复
#2
linzhonglin2011-02-26 12:52
回复 楼主 linzhonglin
其实错误在于ls_condition1="sfsc='1'"
#3
linzhonglin2011-02-26 12:55
回复 楼主 linzhonglin
ls_condition1="sfsc='1'" 直接写成dw_1.setfilter(sfsc='1')是可以的但写成dw_1.setfilter(ls_condition1)就报错
#4
linzhonglin2011-02-26 12:58
急。。。。。。。请高手帮忙
#5
linzhonglin2011-02-26 13:23
回复 4楼 linzhonglin
sfsc字段不存在
1