Schau mal, ob Du damit was anfangen kannst...

Dass ist ein kleiner parser, den ich mal geschrieben habe...

Er versteht anfragen wie diese:
(Browser and not "Internet Explorer") or "Web Statistics"

Und setzt diese in SQL um, dass in einer angegebenen Liste von
Textfeldern sucht...

Einfach komplett in eine ASP-Datei pasten und mal ausprobieren...

Claudius

<% option explicit %>
<%
  dim fields
  fields = split("firstname,lastname,CV",",")
  
  dim res
  res = parse(Request("searchStr"),fields,"AND")
%>
<html><body>
<form method="POST">
  <input name="searchStr" value="<%=Server.HTMLEncode(
Request("searchStr") )%>">
  <input type=submit>
</form>
<b>SELECT * FROM table WHERE</b> <%=res%>
</body></html>

<%
function parse(ByVal searchString,fields,defaultOperator)
  dim tokens,i,inString,char,tok,where,wasStr
  searchString = searchString & " "
  tokens = Array()
  inString=false
  tok = ""
  for i = 1 to len(searchString)
    char = mid(searchString,i,1)
    
    select case char
    case """"
      inString = not inString
      if (tok<>"") then tokens=arrayAdd(tokens,tok,not inString) : tok =
""
    case "(",")"
        if not inString then
          if (tok<>"") then tokens=arrayAdd(tokens,tok,false) : tok = ""
          tokens = arrayAdd(tokens,char,false)
        else
          tok = tok & char
        end if
    case else
          if inString or char<>" " then
            tok = tok & char
          else
            if tok<>"" then tokens=arrayAdd(tokens,tok,false) : tok = ""
          end if
    end select
  next
  
  where="" : wasStr = false
  for each tok in tokens
    select case tok
      case "(",")","AND","OR","NOT"
        where = where & " " & tok & " "
        wasStr = false
      case else
        if wasStr then where = where & " " & defaultOperator & " "
        
        where = where & " (" & join(fields," LIKE " & tok & " OR ") & "
LIKE " & tok & ") "
        
        wasStr = true
    end select
  next
  parse = where
end function

function arrayAdd(arr,ByVal str,isString)
  dim newArr()
  dim i
  redim newArr(ubound(arr)+1)
  for i = 0 to ubound(arr)
    newArr(i) = arr(i)
  next
  
  if not isString and (ucase(str)="AND" or ucase(str)="OR" _
          or ucase(str)="NOT" or str="(" or str=")") then
    str = ucase(str)
  else
    str = "'%" & replace(str,"'","''") & "%'"
  end if
  
  newArr(ubound(newArr)) = str
  arrayAdd = newArr
end function
%>



> -----Original Message-----
> From: Steppel [mailto:[EMAIL PROTECTED]] 
> Sent: Freitag, 3. Mai 2002 17:08
> To: AspGerman Kaffeehaus
> Subject: [aspdecoffeehouse] ASP Suchmaschine
> 
> 
> Hallo :-)
> 
> Kennt jemand von euch eine gute Suchmaschine die auf Access 
> basiert und die
> ich mir nach meinem W�nschen anpassen kann?
> 
> Gru�
> Steppel
> 
> 
> | [aspdecoffeehouse] als [EMAIL PROTECTED] subscribed
> | http://www.aspgerman.com/archiv/aspdecoffeehouse/ = Listenarchiv
> | Sie k�nnen sich unter folgender URL an- und abmelden:
> | 
> http://www.aspgerman.com/aspgerman/listen/anmelden/aspdecoffee
house.asp


| [aspdecoffeehouse] als [email protected] subscribed
| http://www.aspgerman.com/archiv/aspdecoffeehouse/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.aspgerman.com/aspgerman/listen/anmelden/aspdecoffeehouse.asp

Antwort per Email an