473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Keyword(s) query.

My management requested that I make my search engine more user friendly
by "Making it work like Google's". They don't like that they have to
enter a string exactly in the order it's in when searching on a memo
field.

I was wondering if it were possible to run a query that would search a
field on keywords in any order rather than a set consecutive string.
What I mean is typing in "One Two Three" would find "One" or "Three" or
"Two One" rather than only "One Two Three" or "One Two Three Four"

Only way I can think to do it is to parse out the string into separate
words, run separate queries for each word, then somehow link and rank
the results according to which had the most hits.

Is there any way to do this without choking an A97 DB's performance to
death?

Jun 5 '06 #1
2 2269
Okay, here's how I did it.
Create a search form with a place to put all the keywords. On the
AfterUpdate of this field palce this dirty code:
Private Sub Text1_AfterUpdate()
Dim Wrd1, Wrd2, Wrd3, Wrd4, Wrd5, Wrd6, Wrd7, Wrd8 As String

Dim Lett(250) As String
Dim Word(20) As String
j = 1
For i = 1 To Len(Me.Text1)
Lett(i) = Mid(Me.Text1, i, 1)

If Lett(i) = " " Then
j = j + 1
Else
Word(j) = Word(j) + Lett(i)
Select Case j
Case 1
If Word(j) > " " Then Wrd1 = Word(j)
Me!Wrd1 = Wrd1
Case 2
If Word(j) > " " Then Wrd2 = Word(j)
Me!Wrd2 = Wrd2
Case 3
If Word(j) > " " Then Wrd3 = Word(j)
Me!Wrd3 = Wrd3
End Select
End If
Next i

End Sub

I have code for only three words but you can add as many as you want.

I have enought invisible fields on the form for Wrd1, Wrd2, etc.
Behind the search button on the form i open the following query (You can
open a form based on this query if you want):

SELECT Injuries.recno, Injuries.InjuryType, Injuries.Name, Injuries.Date,
Injuries.Criteria, Injuries.InjDept, Injuries.BodyPart, Injuries.Shift,
Injuries.Description, [Criteria] & [BodyPart] & [Description] AS LU
FROM Injuries
WHERE ((([Criteria] & [BodyPart] & [Description]) Like "*" & [Forms]!
[LookupInjury]![Wrd1] & "*" And ([Criteria] & [BodyPart] & [Description])
Like "*" & [Forms]![LookupInjury]![Wrd2] & "*" And ([Criteria] & [BodyPart] &
[Description]) Like "*" & [Forms]![LookupInjury]![Wrd3] & "*"));

As you can see this looks up injuries and I want them to be able to look up
nbased on a Criteria, the body part injured and the type of injury.

Hope this dirty way of doing it helps. It may not look pretty but is
adequate and that is all that matters as far as management is concerned!

An***********@bcbsmn.com wrote:
My management requested that I make my search engine more user friendly
by "Making it work like Google's". They don't like that they have to
enter a string exactly in the order it's in when searching on a memo
field.

I was wondering if it were possible to run a query that would search a
field on keywords in any order rather than a set consecutive string.
What I mean is typing in "One Two Three" would find "One" or "Three" or
"Two One" rather than only "One Two Three" or "One Two Three Four"

Only way I can think to do it is to parse out the string into separate
words, run separate queries for each word, then somehow link and rank
the results according to which had the most hits.

Is there any way to do this without choking an A97 DB's performance to
death?


--
Message posted via http://www.accessmonster.com
Jun 5 '06 #2
thanks for the tip, and sorry for the late reply. I went on vacation
for a few days immediatly after posting this and forgot I posted it.

I think this will work for the application.

Jun 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: teddysnips | last post by:
I am studying for the MSCE/MCDBA exam 70-229. In the book I am using ("MCSA/MCSE/MCDBA Self-Paced Training Kit: Microsoft SQL Server 2000 Database Design and Implementation Exam 70-229, Second...
2
by: david | last post by:
Hi all, I have two tables: workgroups (wg_id, wg_name) workgroups_keywords (wgk_wg_id, wgk_keyword) Each workgroup has an associated list of one or more keywords. What I want do to at...
11
by: Mark Findlay | last post by:
Hello Experts! I am attempting to use the OleDbCommand.ExecuteScaler() function within my ASP.NET C# web page to perform a simple validation, but receive the following error: "Incorrect...
6
by: PieOPah | last post by:
I am trying to write a query that will allow a partial word search. I know that if I have something along the lines of SELECT TblName.Name, TblName.Category, TblName.Type, TblName.Ingredients,...
6
by: issac | last post by:
Hi folks Im trying to do a simple query involving the distinct keyword and an access 2000 db, but have been frittering with it for amost and hour and a half and I cant make it work. This is...
4
by: geetha | last post by:
Dear all, I have a database with all the research capabilities of professors of a university. I need to implement a "keyword search" feature in my welcome page which will actually work like a...
3
by: Redbeard | last post by:
Hi All this is my first time post, be gentle. I am looking at creating a keyword search that searches multiple fields in a Form and then filters records that match the keyword. The Form...
5
by: kanley | last post by:
I have a main table with a text description field. In this field, its populated with a string of data. I need to identify from this string of data the name of the vendor using some keywords. I...
3
by: reyn | last post by:
I want to find this book: The history of Columbia's rebels here is my SQL Query: Select * from Project (Title Like ("*columbia*rebels*")) OR (Description Like ("*columbia*rebels*")) this works...
1
by: jerry101 | last post by:
hi, i stumbled accross a piece of coding in the between the <head> tags where you normally put your keywords etc and one website i saw had this piece of javascript there. <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.