| 发表于:2007-01-09 16:14:24 楼主 |
dim sql as string, sid as string, sname as string sql = "select * from temp1 where " sid = text1.text sname = text2.text if len(sid) = 0 and len(sname) = 0 then exit sub if len(sid) then sql = sql & "id = ' " & sid & " ' " if len(sname) then if len(sid) then sql = sql & "and " sql = sql & "name like '% " & sname & "% ' " end if 这是两个的变量筛选查询,有4个以上更多的变量时用同样的方法变的很复杂,要用什么方式来做,比较容易理解一点 |
|
|
|
|