strSql = "select * from tables"
strBkSql = "select * from tables"
if A <> "" then
strSql = strSql & " where fldA=" & A
end if
'// 判断strSql是否发生改变,如果改变以后用and连接,否则用where
if B <> "" then
if strSql = strBkSql then
strSql = strSql & " where fldB=" & B
else
strSql = strSql & " and fldB=" & B
end if
end if
sql="select * from tables where 1=1"
if a or b<>"" then
sql=sql&" and (a or b)"
end if
if c<>"" then
sql=sql&" and c"
end if
if d<>"" then
sql=sql&" and d"
end if
if e<>"" then
sql=sql&" and e"
end if