首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

like查询有关问题

2012-03-08 
like查询问题input ids0 typetext value nameqian%dim key1key1request(qian)Set rsSe

like查询问题
<input id="s0" type="text" value="" name="qian">

<%
dim key1
key1=request("qian")
Set rs=Server.CreateObject("ADODB.RecordSet") 
sql = "select * from sanXdingcha where allowinvite like '%"&key1&"%'"
rs.open sql,conn,1,1 
Do While Not rs.eof
%>

我想输入123即查询含带有1、2、3 的信息,而不是查询123(一百二十三的意思)

求思路求代码!谢谢

[解决办法]
dim Str
dim getchar
dim sqlWhere
sqlWhere = " Where 1=0 "
For i=1 to len(Str)
getchar = mid(Str, i)
sqlWhere = sqlWhere & " or allowinvite like '%"& getchar &"%'"
Next

热点排行