数据库数据:123N—123或D123—123
希望能用123***123的格式;即用“*”查询
不知道能不能达到这种效果!
还请各位指点!
sql="select * from ABB where 1=1"
if ID<>"" then
sql=sql&"and ID like '%"&ID&"%' "
end if
if lph<>"" then
sql=sql&"and lph like '*"&lph&"*'"
end if
if gg<>"" then
sql=sql&"and gg like '%"&gg&"%' "
end if
if code<>"" then
sql=sql&"and gh like '%"&code&"%' "
end if
if code1<>"" then
sql=sql&"and hd like '%"&code1&"%' "
end if
if number<>"" then
sql=sql&"and number like '%"&number&"%' "
end if
if zs<>"" then
sql=sql&"and zs like '%"&zs&"%' "
end if
if ts<>"" then
sql=sql&"and ts like '%"&ts&"%' "
end if
if bz<>"" then
sql=sql&"and bz like '%"&bz&"%' "
end if
sql=sql&" order by "&OrderField&" "&Order
rs.open sql,conn,1,1
if err.number<>0 then
call MsgBox("数据库中无数据","Back","None")
response.End
end if
if rs.eof And rs.bof then
call MsgBox("对不起,找不到你所需的信息!","Back","None")
response.End
else
totalPut=rs.recordcount