ASP实现智能搜索
来源:互联网 发布:每日任务记录软件 编辑:程序博客网 时间:2024/06/09 19:54
<%
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
%>
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实现智能搜索
- ASP智能搜索的实现
- ASP智能搜索的实现
- ASP智能搜索的实现
- ASP智能搜索的实现
- ASP智能搜索的实现
- ASP智能搜索的实现
- ASP实现网站智能分词搜索
- ASP应用程序怎么实现智能搜索
- 用ajax和asp.net实现智能搜索功能
- 在ASP应用程序中加入智能搜索
- asp.net 仿百度搜索 智能感知快速搜索
- 结合jquery实现搜索智能提示
- jquery实现智能感知式搜索
- jquery实现智能感知式搜索
- Solr Suggest实现搜索智能提示
- Solr Suggest实现搜索智能提示
- Solr Suggest实现搜索智能提示
- 中小企业安全路由器配置及管理
- java计算器
- ASP数据库语法总结
- 无线局域网规划指南(一)
- volatile关键字的用义和用法(一)
- ASP实现智能搜索
- IPTV关键技术研究与标准制定
- 好久没更新这里了
- DateValue函数
- PHP学习第二天
- ASP.NET Web Page应用深入探讨
- 网络管理员常见错误集锦
- asp sql server2000 rs.recordcount=-1 解决方法
- HttpServletRequest接口