pb中子数据窗口设置模糊查询

//在数据窗口中editchanged()

string strdatacol, strfilter, strdisplaycol,strpym

datawindowchild obj_dwc

//子数据窗口根据设备名称和拼音码来查询
choose case dwo.name
case 'khbm'
strdatacol = this.Describe(dwo.name + ".DDDW.DataColumn")
strdisplaycol = this.Describe(dwo.name + ".DDDW.DisplayColumn")
strpym = 'pym'
if strdisplaycol = '?' or strdisplaycol = '!' then
else
this.getchild(dwo.name, obj_dwc)
if len(trim(data)) = 0 or isnull(data) then
strfilter = strdisplaycol + ' like ("' + data + '%")'
else
strFilter = strFilter + "(" + strdisplaycol + " like ('%" + data + "%')" + ")"
strFilter = strFilter + " or "
strFilter = strFilter + "("+ strpym + " like ('"+ data +"%') "+")"

end if
obj_dwc.setredraw(false)
obj_dwc.setfilter(strfilter)
obj_dwc.filter()
obj_dwc.setsort(strdisplaycol + ' A, ' + strdatacol + ' A')
obj_dwc.sort()
obj_dwc.setredraw(true)
if ilngrow <> row then ilngrow = row
if istrdwoname <> dwo.name then istrdwoname = dwo.name
end if

end choose




你可能感兴趣的:(pb学习,pb,子数据窗口,模糊查询)