49520057 2009-8-25 11:31
请问下怎么制作模糊搜索功能
Microsoft Office Excel 2003能制作模糊搜索功能吗?
就是类似于我打一个姓,就能出现相关有可能我需要的资料
或者最好是百度那种,打一个字母就能出现
这类东西Microsoft Office Excel 2003能制作吗
有什么专门制作的软件吗?
能否把这个加进去别的软件中使用
有这方面技术的朋友帮下忙
我想制作一款管理软件
要超方便的,所以这个很有必要学学
ttfrist 2009-8-25 12:07
如果是用visual系列编程,在制作菜单的时候就可以实现这个功能。其他的软件基本上也都有类似的功能。
ll12100 2009-8-25 12:17
把文本框的值传进来,然后利用SQL语句中的like模糊查询。
如: sql="select * from news where title like '%"&request("title")&"%'"
楼主在查询的时候还要注意过滤空格和单引号等。
下面这文章是介绍ASP做查询功能,楼主可以看一下。
面是库中URLINDEX表:URL和Keywords字段分别添加了索引.
URL 文本 (索引:有(无重复))
Title 文本
Description 文本
Summary 文本
Keywords 文本(索引:有(无重复))
doquery.asp
<HTML><HEAD><TITLE>简单搜索引擎</TITLE></HEAD>
<BODY BGCOLOR=#ffffff MARGINWIDTH="0" MARGINHEIGHT="0"
LEFTMARGIN=0 TOPMARGIN=0>
<FORM METHOD="post" ACTION="doquery.asp?act=search">
Query: <INPUT TYPE="Text" NAME="QueryString"><BR>
<INPUT TYPE="Submit" VALUE="Submit">
</FORM>
</CENTER>
<%
dim act
act=request("act")
if(act="search") then
QueryString = Request.form( "QueryString" )
QueryWords = Split( QueryString )
strIndent = " "
如果搜索为空则返回
If QueryString = "" Then
Response.Redirect( "default.asp" )
End If
Session.timeout = 2
If IsObject(Session("sitesearch_conn")) Then
Set conn = Session("sitesearch_conn")
Else
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("database/SiteSearch.mdb"),"",""
Set Session("sitesearch_conn") = conn
End If
查询语句
sql = "SELECT * FROM [URLIndex] WHERE"
搜索Description字段
sql = sql & " ( [Description] LIKE '%" & QueryWords( 0 ) & "%'" ' First
For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
If uCase( QueryWords( i-1 ) ) = "OR" Then
sql = sql & " OR [Description] LIKE '%" & QueryWords( i ) & "%'"
Else
sql = sql & " AND [Description] LIKE '%" & QueryWords( i ) & "%'"
End If
End If
Next
搜索Keywords字段
sql = sql & " ) OR ( [Keywords] LIKE '%" & QueryWords( 0 ) & "%'"
For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
If uCase( QueryWords( i-1 ) ) = "OR" Then
sql = sql & " OR [Keywords] LIKE '%" & QueryWords( i ) & "%'"
Else
sql = sql & " AND [Keywords] LIKE '%" & QueryWords( i ) & "%'"
End If
End If
Next
搜索Title字段
sql = sql & " ) OR ( [Title] LIKE '%" & QueryWords( 0 ) & "%'"
For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
If uCase( QueryWords( i-1 ) ) = "OR" Then
sql = sql & " OR [Title] LIKE '%" & QueryWords( i ) & "%'"
Else
sql = sql & " AND [Title] LIKE '%" & QueryWords( i ) & "%'"
End If
End If
Next
搜索Summary字段
sql = sql & " ) OR ( [Summary] LIKE '%" & QueryWords( 0 ) & "%'"
For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
If uCase( QueryWords( i-1 ) ) = "OR" Then
sql = sql & " OR [Summary] LIKE '%" & QueryWords( i ) & "%'"
Else
sql = sql & " AND [Summary] LIKE '%" & QueryWords( i ) & "%'"
End If
End If
Next
sql = sql & " )"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
Response.Write "<BR><B> 你搜索的是: </B> " & QueryString
Response.Write "<BR><B> 搜索的关键字: </B> "
For i = LBound( QueryWords ) to UBound( QueryWords )
Response.Write "<BR>" & strIndent & i & ": " & QueryWords( i )
Next
Print the SQL String
Response.Write "<BR><B> sql 语句 : </B> " & sql
Print the Results
Response.Write "<BR><B> 结果 : </B> <UL>"
On Error Resume Next
rs.MoveFirst
Do While Not rs.eof
Response.Write "<BR>" & "<A HREF='OpenPage.asp?IndexURL=" & rs.Fields("URL").Value & "'>" & rs.Fields("Title") & "</A> - "
Response.Write rs.Fields("Description") & "<BR>"
Response.Write " <FONT SIZE=2>URL: " & rs.Fields("URL") & "</FONT>"
Response.Write "<HR SIZE=1 WIDTH=200 ALIGN=LEFT>"
rs.MoveNext
Loop
Response.Write "</UL>"
end if
%>
</BODY>
</HTML>
alanjackson 2009-8-25 13:04
现在office嵌入软件 已经慢慢被淘汰了 渐渐开始实用类似DEV之类更加灵活多变 安全系数高的软件来替代原来的OFFICE
如果要加做新的软件 可以用数据库的存储过程来做核心计算 打成邮包后 让前台查询调用 然后显示就可以了。
49520057 2009-9-3 06:42
首先先感谢3楼
不管方法能不能用
都谢谢你先
不过我实在弄不懂那东西
请问有没有视频教程啊
这样我比较好学