This topic is locked

advanced search case insensitive

8/22/2004 8:55:10 AM
ASPRunnerPro General questions
author

I read the reply to the question "...How do make searches case insensitive", the answer refers only to the quick search. I tried it and it works perfect. Is there a way to make search case insensitive in the advanced search?

Sergey Kornilov admin 8/28/2004

Hi,
you can try something like this (modify ..._list.asp file):

' advanced search

if Request.Form("action")="AdvancedSearch" then

sWhere=""

For i = 1 To Request.Form("SearchFor").Count 

  strSearchFor=UCase(Trim(Request.Form("SearchFor")(i)))

  strSearchFor2=UCase(Trim(Request.Form("SearchFor2")(i)))

  if strSearchFor<>"" then

  if sWhere="" then sWhere=" where 1=1"

  strSearchOption=Trim(Request.Form("SearchOption")(i))

  sWhere = sWhere & " and UCase(" & AddWrappers(Request.Form("FieldName")(i)) & ") " & StrWhere(Request.Form("FieldName")(i), strSearchFor, strSearchOption, strSearchFor2)

  end if

next

if InStr(strSQL, " where ") > 0 then sWhere = " and (" & Mid(sWhere, 8) & " ) "

strSQL = strSQL & sWhere

end if


I hope this helps.

501074 9/15/2004

Thanks,
after updating the code to be as you suggested, no matter what value I enter in the advanced search field\s, I get the entire list (all the records) as result.
Do you have an idea?
Thanks a lot

Sergey Kornilov admin 9/15/2004

Hi,
You can zip and send to support@xlinesoft.com the whole content of ASPRunner output folder ( ASP files, include files, database etc.) along with the project file? I'll find what's wrong running it on my test box.