字段PowerList里面的值:KSO10000,KSO10021,KSO10004,KSO10022,KSO10020,KSO10008
现在要判断,当PowerList里面存在KSO10004这个值的时候,输出:好
VBScript code:
<%
set rs=server.CreateObject("adodb.recordset")
sql="select PowerList from 表 where PowerList ='KSO10004'"
rs.open sql,conn,1,1
if not rs.eof then
response.Write("好")
end if
%>
这样??
VBScript code:
if inStr("KSO10000,KSO10021,KSO10004,KSO10022,KSO10020,KSO10008","KSO10004" ) then Response.write "好"
VBScript code:
PowerList=KSO10000,KSO10021,KSO10004,KSO10022,KSO10020,KSO10008
PowerList=","&PowerList&","
checkStr=KSO10000 '带检查的值
checkStr=","&checkStr&","
if (instr(PowerList,"checkStr")>0) then
response.write("好")
end if
我这个写法也适合判断数字
VBScript code:
Function chkStrInStrs(vStr,vStrs)