|
-
November 19th, 1998, 07:22 AM
#1
help implementing a search facility
Hi all !
i need to implement a search facility....for this i am asking a user to enter details in a text box...
PROBLEM
The backend should be able to take the string and based on what has been entered in the text box see if there are any "AND" , "OR" in the
string .....and then execute the query based on that ....
the code that i am using to find out the "and" or "OR" is
dim indkeywords(10)
k=1
for n=1 to len(keyword)
ch=mid(keyword,n,1)
indkeywords(k)=indkeywords(k) & ch
if ch="and" then k=k+1
else
if ch="or" then
k=k+1
end if
end if
next
but this doesn't find the "and" or "OR"
any ideas ..or if there is any other way of doing this ...i would very much appreciate the help
many thanks
daksh
[email protected]
-
November 19th, 1998, 08:30 AM
#2
Re: help implementing a search facility
The first thing which strikes me is that you are comparing ch (1 character in length) with 'And' & 'Or', and not indKeywords.
Perhaps a better way would be to use 'InStr'. You could use this to find all the 'And' & 'Or's
-
November 19th, 1998, 08:32 AM
#3
Re: help implementing a search facility
Why don't you use the InStr function? If it finds anything, then you can check to see if it's the operator or that it's part of the searchstring (I think that's easier then what you do now)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|