主页 > 知识库 > ASP实现智能搜索实现代码

ASP实现智能搜索实现代码

热门标签:Linux服务器 银行业务 阿里云 电子围栏 服务器配置 团购网站 科大讯飞语音识别系统 Mysql连接数设置
%
Function AutoKey(strKey)

Const lngSubKey=2
lngLenKey=Len(strKey)

Select Case lngLenKey
Case 0   '若为空串,转到出错页 
Response.Redirect "Error.htm"
Case 1   '若长度为1,则不设任何值 
strNew1=""
strNew2=""
Case Else  '若长度大于1,则从字符串首字符开始,循环取长度为2的子字符串作为查询条件 

For i=1 To lngLenKey-(lngSubKey-1)

strSubKey=Mid(strKey,i,lngSubKey)

strNew1=strNew1  " Or U_Name like '%"  strSubKey  "%'"
strNew2=strNew2  " Or U_Info like '%"  strSubKey  "%'"
Next
End Select

'得到完整的SQL语句 
AutoKey="Select * from T_Sample where U_Name like '%"  strKey  "%' Or U_Info like '%"  strKey  "%'"  strNew1  strNew2
End Function
%>

标签:衡水 枣庄 萍乡 江苏 广元 大理 蚌埠 衢州

巨人网络通讯声明:本文标题《ASP实现智能搜索实现代码》,本文关键词  ;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 收缩
    • 微信客服
    • 微信二维码
    • 电话咨询

    • 400-1100-266