例如表名为room 类型字段为style,房间价格为price
在按房间价格查询按钮的clicked事件中编写如下代码:
dw_1.reset()
string ls_price1,ls_price2,ls_sql_old,ls_sql,ls_condition
ls_price1 = sle_2.text
ls_price2 = sle_3.text
if isnull(ls_price1) then
messagebox("提示","房间价格起始不能为空")
return
end if
if isnull(ls_price2) then
messagebox("提示","房间价格止不能为空")
return
end if
ls_sql_old = dw_1.getsqlselect()
ls_condition = " where price > '+ls_price1+' and price < '+ls_price2+' "
ls_sql = ls_sql_old + ls_condition
dw_1.setsqlselect(ls_sql)
dw_1.retrieve()
之后就是你想要得到的结果