HELP! OR on the words of an ASP DRW searchbox

I have a simple frontpage generated asp page with one drop-down and three textboxes, all used to search an access database. DRW created this search, I customized the sql query to use the LIKE expression on all four inputs stated above and to query specific columns.

Very simple. I modified the results area to hide specific fields that have empty results: a simple if/then loop: "if the asc(resultstring)=38 then hide this field", don't ask me why but ascii code 38 turned out to be the code of empty fields in my searches.

A final complication is that results are dislpayed as links on another page, and clicking on these links will show this page with all the details.

I hope you can follow till now because it is really simple.

Now, the QUESTION: I would like to enable OR on the words entered in my textboxes. merely replacing " " with "%" is not enough because the words have to appear in the document in the same order entered in the search, which is not correct. An "any word", "all word" or "exact words" option is ideal but prbably too comlpicated for me...

This probably means there should be an array from 0 to unbound that takes all the words separated by space and store them, and then run a query specially built on all the words...
Could anyone assist me? hhammash?

Sorry to dump all the code, I am not sure which part you need. But if you select it all and paste it in frontpage, then the colors will show clearly.

Thanks,
Tony

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>Search</title>
</head>

<body>



<form BOTID="0" METHOD="POST" ACTION="picklist.asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
  <table BORDER="0">
    <tr>
      <td><b>City_country</b></td>
      <td>
      <nobr>
      <!--webbot bot="DatabaseRegionStart" s-columnnames="City_country" s-columntypes="202" s-dataconnection="rdconn" b-tableformat="FALSE" b-menuformat="TRUE" s-menuchoice="City_country" s-menuvalue="City_country" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource s-displaycolumns="City_country" s-criteria s-order s-sql="SELECT DISTINCT City_country FROM DRI" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="1" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" preview=" &lt;span style=&quot;color: rgb(0,0,0); background-color: rgb(255,255,0)&quot;&gt;Database&lt;/span&gt; " startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT DISTINCT City_country FROM DRI"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="rdconn"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="City_country"
fp_sMenuValue="City_country"
fp_iDisplayCols=1
fp_fCustomQuery=True
BOTID=1
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="10223" --><select NAME="City_country" SIZE="1">
      <option selected value="%">All Cities</option>
      <!--webbot bot="AspInclude" clientside u-incfile="_fpclass/fpdbrgn1.inc" startspan --><!--#include file="_fpclass/fpdbrgn1.inc"--><!--webbot bot="AspInclude" endspan i-checksum="62210" -->
      <option><%=FP_FieldHTML(fp_rs,"City_country")%></option>
      <!--webbot bot="AspInclude" clientside u-incfile="_fpclass/fpdbrgn2.inc" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"--><!--webbot bot="AspInclude" endspan i-checksum="62218" -->
      </select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside preview=" &lt;span style=&quot;color: rgb(0,0,0); background-color: rgb(255,255,0)&quot;&gt;Results&lt;/span&gt; " startspan --><!--webbot bot="DatabaseRegionEnd" endspan --></nobr></td>
    </tr>
    <tr>
      <td><b>Name_english</b></td>
      <td>
      <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-allow-digits="TRUE" b-allow-whitespace="TRUE" s-allow-other-chars="; : &quot; [ { ] } ( ) + _ - \ / . ," --><input NAME="Name_english" VALUE="<%=Request("Name_english")%>" size="20"></td>
    </tr>
    <tr>
      <td><b>Basic_sciences</b></td>
      <td>
      <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-allow-digits="TRUE" b-allow-whitespace="TRUE" s-allow-other-chars="; : &quot; [ { ] } ( ) + _ - \ / . ," --><input NAME="Basic_sciences" VALUE="<%=Request("Basic_sciences")%>" size="20"></td>
    </tr>
    <tr>
      <td><b>Freetext</b></td>
      <td>
      <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-allow-digits="TRUE" b-allow-whitespace="TRUE" s-allow-other-chars="; : &quot; [ { ] } ( ) + _ - \ / . ," --><input NAME="Freetext" VALUE="<%=Request("Freetext")%>" size="20"></td>
    </tr>
  </table>
  <p>
  <input TYPE="Submit"><input TYPE="Reset"><!--webbot bot="SaveAsASP" clientside suggestedext="asp" preview=" " startspan --><!--webbot bot="SaveAsASP" endspan --></p>
</form>
<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-columntypes="3,202,202,203,203,203,202,203,203,203,203,203,203,202,202,202,202,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,202,203,203,203" s-dataconnection="rdconn" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource s-displaycolumns="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-criteria s-order s-sql="SELECT * FROM DRI WHERE (City_country LIKE '%::City_country::%' AND Name_english LIKE '%::Name_english::%' AND  (Basic_sciences LIKE '%::Basic_sciences::%' OR Applied_sciences LIKE '%::Basic_sciences::%' OR Social_sciences LIKE  '%::Basic_sciences::%' OR Other_fields LIKE '%::Basic_sciences::%') AND (Name_english LIKE  '%::Freetext::%' OR Name_arabic LIKE '%::Freetext::%' OR Date LIKE '%::Freetext::%' OR Head LIKE '%::Freetext::%' OR Address  LIKE '%::Freetext::%' OR City_country LIKE '%::Freetext::%' OR Telephone LIKE '%::Freetext::%' OR Fax LIKE '%::Freetext::%'  OR Email LIKE '%::Freetext::%' OR Website LIKE '%::Freetext::%' OR Gov_nat LIKE '%::Freetext::%' OR Languages LIKE  '%::Freetext::%' OR Basic_sciences LIKE '%::Freetext::%' OR Applied_sciences LIKE '%::Freetext::%' OR Social_sciences LIKE  '%::Freetext::%' OR Other_fields LIKE '%::Freetext::%' OR Research_pro LIKE '%::Freetext::%' OR Research_supp LIKE  '%::Freetext::%' OR Technicians LIKE '%::Freetext::%' OR Staff LIKE '%::Freetext::%' OR Lib_vol LIKE '%::Freetext::%' OR  Lib_per LIKE '%::Freetext::%' OR Lib_other LIKE '%::Freetext::%' OR Mission LIKE '%::Freetext::%' OR Organization LIKE  '%::Freetext::%' OR R_and_D LIKE '%::Freetext::%' OR Training LIKE '%::Freetext::%' OR Meetings LIKE '%::Freetext::%' OR  Services LIKE '%::Freetext::%' OR Pub_non_rec LIKE '%::Freetext::%' OR Pub_rec LIKE '%::Freetext::%' OR Online LIKE  '%::Freetext::%' OR Links LIKE '%::Freetext::%' OR Affiliations LIKE '%::Freetext::%' OR Facilities LIKE '%::Freetext::%' OR  Achievements LIKE '%::Freetext::%' OR Future LIKE '%::Freetext::%' OR Fund_sources LIKE '%::Freetext::%' OR Currency LIKE  '%::Freetext::%' OR Budget LIKE '%::Freetext::%' OR Budget_dist LIKE '%::Freetext::%' OR Sources LIKE '%::Freetext::%'))&lt;br&gt;" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="City_country=&amp;Name_english=&amp;Basic_sciences=&amp;Basic_sciences=&amp;Basic_sciences=&amp;Basic_sciences=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=&amp;Freetext=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="1" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM DRI WHERE (City_country LIKE '%::City_country::%' AND Name_english LIKE '%::Name_english::%' AND  (Basic_sciences LIKE '%::Basic_sciences::%' OR Applied_sciences LIKE '%::Basic_sciences::%' OR Social_sciences LIKE  '%::Basic_sciences::%' OR Other_fields LIKE '%::Basic_sciences::%') AND (Name_english LIKE  '%::Freetext::%' OR Name_arabic LIKE '%::Freetext::%' OR Date LIKE '%::Freetext::%' OR Head LIKE '%::Freetext::%' OR Address  LIKE '%::Freetext::%' OR City_country LIKE '%::Freetext::%' OR Telephone LIKE '%::Freetext::%' OR Fax LIKE '%::Freetext::%'  OR Email LIKE '%::Freetext::%' OR Website LIKE '%::Freetext::%' OR Gov_nat LIKE '%::Freetext::%' OR Languages LIKE  '%::Freetext::%' OR Basic_sciences LIKE '%::Freetext::%' OR Applied_sciences LIKE '%::Freetext::%' OR Social_sciences LIKE  '%::Freetext::%' OR Other_fields LIKE '%::Freetext::%' OR Research_pro LIKE '%::Freetext::%' OR Research_supp LIKE  '%::Freetext::%' OR Technicians LIKE '%::Freetext::%' OR Staff LIKE '%::Freetext::%' OR Lib_vol LIKE '%::Freetext::%' OR  Lib_per LIKE '%::Freetext::%' OR Lib_other LIKE '%::Freetext::%' OR Mission LIKE '%::Freetext::%' OR Organization LIKE  '%::Freetext::%' OR R_and_D LIKE '%::Freetext::%' OR Training LIKE '%::Freetext::%' OR Meetings LIKE '%::Freetext::%' OR  Services LIKE '%::Freetext::%' OR Pub_non_rec LIKE '%::Freetext::%' OR Pub_rec LIKE '%::Freetext::%' OR Online LIKE  '%::Freetext::%' OR Links LIKE '%::Freetext::%' OR Affiliations LIKE '%::Freetext::%' OR Facilities LIKE '%::Freetext::%' OR  Achievements LIKE '%::Freetext::%' OR Future LIKE '%::Freetext::%' OR Fund_sources LIKE '%::Freetext::%' OR Currency LIKE  '%::Freetext::%' OR Budget LIKE '%::Freetext::%' OR Budget_dist LIKE '%::Freetext::%' OR Sources LIKE '%::Freetext::%')) "
fp_sDefault="City_country=&Name_english=&Basic_sciences=&Basic_sciences=&Basic_sciences=&Basic_sciences=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext=&Freetext="
fp_sNoRecords="No records returned."
fp_sDataConn="rdconn"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=1
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=43
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="59923" -->
<% If asc(FP_FieldVal(fp_rs,"Name_English")) <> 38 Then %>
<p><b>Name_english:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Name_english" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Name_english&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Name_english")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="30819" --></p>
<% End If
%>
<% If LEN(FP_FieldVal(fp_rs,"Name_arabic")) <> 6 Then %>
<p><b>Name_arabic:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Name_arabic" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Name_arabic&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Name_arabic")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="28275" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Date")) <> 38 Then %>
<p><b>Date:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Date" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Date&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Date")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="3267" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Head")) <> 38 Then %>
<p><b>Head:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Head" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Head&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Head")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="4014" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Address")) <> 38 Then %>
<p><b>Address:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Address" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Address&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Address")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="12103" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"City_country")) <> 38 Then %>
<p><b>City_country:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="City_country" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;City_country&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"City_country")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="33203" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Telephone")) <> 38 Then %>
<p><b>Telephone:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Telephone" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Telephone&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Telephone")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="19510" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Fax")) <> 38 Then %>
<p><b>Fax:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Fax" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Fax&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Fax")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="1677" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Email")) <> 38 Then %>
<p><b>Email:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Email" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Email&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Email")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="8328" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Website")) <> 38 Then %>
<p><b>Website:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Website" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Website&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Website")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="13439" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Gov_nat")) <> 38 Then %>
<p><b>Gov_nat:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Gov_nat" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Gov_nat&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Gov_nat")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="13783" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Languages")) <> 38 Then %>
<p><b>Languages:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Languages" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Languages&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Languages")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="18936" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Basic_sciences")) <> 38 Then %>
<p><b>Basic_sciences:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Basic_sciences" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Basic_sciences&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Basic_sciences")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="39710" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Applied_sciences")) <> 38 Then %>
<p><b>Applied_sciences:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Applied_sciences" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Applied_sciences&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Applied_sciences")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="42285" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Social_sciences")) <> 38 Then %>
<p><b>Social_sciences:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Social_sciences" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Social_sciences&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Social_sciences")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="41073" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Other_fields")) <> 38 Then %>
<p><b>Other_fields:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Other_fields" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Other_fields&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Other_fields")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="33217" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Research_pro")) <> 38 Then %>
<p><b>Research_pro:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Research_pro" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Research_pro&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Research_pro")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="31638" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Research_supp")) <> 38 Then %>
<p><b>Research_supp:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Research_supp" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Research_supp&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Research_supp")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="35515" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Technicians")) <> 38 Then %>
<p><b>Technicians:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Technicians" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Technicians&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Technicians")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="29899" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Staff")) <> 38 Then %>
<p><b>Staff:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Staff" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Staff&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Staff")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="10090" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Lib_vol")) <> 38 Then %>
<p><b>Lib_vol:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Lib_vol" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Lib_vol&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Lib_vol")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="13331" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Lib_per")) <> 38 Then %>
<p><b>Lib_per:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Lib_per" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Lib_per&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Lib_per")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="13323" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Lib_other")) <> 38 Then %>
<p><b>Lib_other:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Lib_other" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Lib_other&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Lib_other")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="20012" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Mission")) <> 38 Then %>
<p><b>Mission:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Mission" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Mission&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Mission")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="13432" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Organization")) <> 38 Then %>
<p><b>Organization:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Organization" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Organization&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Organization")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="33657" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"R_and_D")) <> 38 Then %>
<p><b>R_and_D:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="R_and_D" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;R_and_D&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"R_and_D")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="11624" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Training")) <> 38 Then %>
<p><b>Training:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Training" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Training&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Training")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17337" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Meetings")) <> 38 Then %>
<p><b>Meetings:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Meetings" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Meetings&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Meetings")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="15543" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Services")) <> 38 Then %>
<p><b>Services:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Services" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Services&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Services")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="15824" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Pub_non_rec")) <> 38 Then %>
<p><b>Pub_non_rec:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Pub_non_rec" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Pub_non_rec&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Pub_non_rec")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="31496" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Pub_rec")) <> 38 Then %>
<p><b>Pub_rec:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Pub_rec" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Pub_rec&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Pub_rec")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="14883" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Online")) <> 38 Then %>
<p><b>Online:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Online" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Online&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Online")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="16003" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Links")) <> 38 Then %>
<p><b>Links:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Links" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Links&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Links")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="8309" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Affiliations")) <> 38 Then %>
<p><b>Affiliations:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Affiliations" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Affiliations&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Affiliations")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="31513" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Facilities")) <> 38 Then %>
<p><b>Facilities:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Facilities" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Facilities&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Facilities")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="28778" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Achievements")) <> 38 Then %>
<p><b>Achievements:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Achievements" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Achievements&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Achievements")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="30669" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Future")) <> 38 Then %>
<p><b>Future:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Future" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Future&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Future")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="16371" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Fund_sources")) <> 38 Then %>
<p><b>Fund_sources:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Fund_sources" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Fund_sources&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Fund_sources")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="33066" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Currency")) <> 38 Then %>
<p><b>Currency:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Currency" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Currency&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Currency")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17072" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Budget")) <> 38 Then %>
<p><b>Budget:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Budget" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Budget&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Budget")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="16139" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Budget_dist")) <> 38 Then %>
<p><b>Budget_dist:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Budget_dist" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Budget_dist&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Budget_dist")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="31775" --></p>
<% End If
%>
<% If asc(FP_FieldVal(fp_rs,"Sources")) <> 38 Then %>
<p><b>Sources:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Name_english,Name_arabic,Date,Head,Address,City_country,Telephone,Fax,Email,Website,Gov_nat,Languages,Basic_sciences,Applied_sciences,Social_sciences,Other_fields,Research_pro,Research_supp,Technicians,Staff,Lib_vol,Lib_per,Lib_other,Mission,Organization,R_and_D,Training,Meetings,Services,Pub_non_rec,Pub_rec,Online,Links,Affiliations,Facilities,Achievements,Future,Fund_sources,Currency,Budget,Budget_dist,Sources" s-column="Sources" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Sources&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Sources")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="14560" --></p>
<% End If
%>
<hr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="1" clientside tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD ALIGN=LEFT VALIGN=MIDDLE&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button VALUE=&quot;  |&lt;  &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;   &lt;  &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;  &gt;   &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;  &gt;|  &quot;&gt;  [1/1]&lt;/NOBR&gt;&lt;BR&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --><p>&nbsp;</p>
<p>&nbsp;</p>



</body></html>
tonikaramAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hhammashCommented:
Hi,

Your use of <% End if is wrong,  and the asc can be replaced.

Try:
<% If Len(FP_FieldVal(fp_rs,"FieldName")) > 0 Then %>
<%=FP_FieldVal(fp_rs,"FieldName")%><br>
<% End If %>

If the Field has data, it will display the field otherwise it will not.

Best regards
hhammash
0
hhammashCommented:
Hi again,

I did not understand what is between the If and End if, anyway try this too:

<% If Len(FP_FieldVal(fp_rs,"FieldName")) > 0 Then %>
Your long line comes here
<% End If %>


Best regards
hhammash
0
hhammashCommented:
Hi,

Can you explain to me what is your second question about "" and "%"  ...etc.

Don't worry,  it will be solved.

Best regards
hhammash
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

hhammashCommented:
Hi,

Sorry for saying that your use of End If is wrong, I noticed now that the closing tag is on the following line. But you should use the Len command to see if the field has data.

This will solve your empty field problem.

Best regards
hhammash
0
tonikaramAuthor Commented:
Hi hhammash,

Regarding your two points:

- I tried using LEN(). But it turned out that fields that had no data were 6 long! (very strange) and an ascii of 38. If I display the LEN() of empty fields, it returned 6!.. Therefore the if-then did not work unless I did this way:
<% If Len(FP_FieldVal(fp_rs,"FieldName")) <> 6 Then %>
Your long line comes here
<% End If %>
but the word "health" was ruled out too because it also had 6 characters. The closest to logic I could find was the ascii of 38 (except for one arabic field, which always returned 38, and that is the only place where I used the LEN() <> 6 condition, because I have no arabic fields with only 6 characters.


- regarding your second point:
"Can you explain to me what is your second question about "" and "%"  ...etc."

I tried doing this:
user enters this in the search box: "water energy"
I transform it to: "water%energy"
and the sql query becomes:
SELECT * FROM DRI WHERE (COLUMN LIKE '%water%energy%')

and that way I can get results if the two words appear in the document, but only if they are in the CORRECT order, which makes this method not good. the best is to OR the two words (or more than two) that the user enters..

Thanks,
Tony

0
hhammashCommented:
Hi,

Why did you put <>6?

Try using:
<% If Trim(FP_FieldVal(fp_rs,"FieldName"))>0 Then %>
Your long line comes here
<% End If %>

I'll look into the other problem.

Best regards
hhammash

0
hhammashCommented:
Hi,

Can you post your SQL?

Is it this one:
---------------
SELECT * FROM DRI WHERE (COLUMN LIKE '%water%energy%')

I tried:
SELECT * FROM Customers WHERE (ContactTitle  like  '%Sales Representative%')

If you are searching a text field,  it should be:
SELECT * FROM Customers WHERE (ContactTitle LIKE '%::ContactTitle::%')

It is working for me with no problem.


Would you please post your SQL?

hhammash

0
tonikaramAuthor Commented:
Yes hhammash,

The SQL is below. Assume this is the text in one of the columns I am searching:

"We are a research program. We work with pollution, energy and water"

The user searches for this: "water pollution"

Sql obviously returns no results. I want it to return all documents that have either water or pollution. If there was an OR between these two words somehow, then the sentence above would have been returned. How can we let this search return the above sentence.

Below is my sql. It is very simple but very long. Actually, I have four textfields, and the last one is tested against all the columns of the database that is why it is long.

By the way, the statement
"If Trim(FP_FieldVal(fp_rs,"Basic_sciences"))>0 Then"

returns typemismatch error:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "Seed pathology and i"]'

Thanks,
Tony
SQL QUERY:

SELECT * FROM DRI WHERE (City_country LIKE '%::City_country::%' AND Name_english LIKE '%::Name_english::%' AND  (Basic_sciences LIKE '%::Basic_sciences::%' OR Applied_sciences LIKE '%::Basic_sciences::%' OR Social_sciences LIKE  '%::Basic_sciences::%' OR Other_fields LIKE '%::Basic_sciences::%') AND (Name_english LIKE  '%::Freetext::%' OR Name_arabic LIKE '%::Freetext::%' OR Date LIKE '%::Freetext::%' OR Head LIKE '%::Freetext::%' OR Address  LIKE '%::Freetext::%' OR City_country LIKE '%::Freetext::%' OR Telephone LIKE '%::Freetext::%' OR Fax LIKE '%::Freetext::%'  OR Email LIKE '%::Freetext::%' OR Website LIKE '%::Freetext::%' OR Gov_nat LIKE '%::Freetext::%' OR Languages LIKE  '%::Freetext::%' OR Basic_sciences LIKE '%::Freetext::%' OR Applied_sciences LIKE '%::Freetext::%' OR Social_sciences LIKE  '%::Freetext::%' OR Other_fields LIKE '%::Freetext::%' OR Research_pro LIKE '%::Freetext::%' OR Research_supp LIKE  '%::Freetext::%' OR Technicians LIKE '%::Freetext::%' OR Staff LIKE '%::Freetext::%' OR Lib_vol LIKE '%::Freetext::%' OR  Lib_per LIKE '%::Freetext::%' OR Lib_other LIKE '%::Freetext::%' OR Mission LIKE '%::Freetext::%' OR Organization LIKE  '%::Freetext::%' OR R_and_D LIKE '%::Freetext::%' OR Training LIKE '%::Freetext::%' OR Meetings LIKE '%::Freetext::%' OR  Services LIKE '%::Freetext::%' OR Pub_non_rec LIKE '%::Freetext::%' OR Pub_rec LIKE '%::Freetext::%' OR Online LIKE  '%::Freetext::%' OR Links LIKE '%::Freetext::%' OR Affiliations LIKE '%::Freetext::%' OR Facilities LIKE '%::Freetext::%' OR  Achievements LIKE '%::Freetext::%' OR Future LIKE '%::Freetext::%' OR Fund_sources LIKE '%::Freetext::%' OR Currency LIKE  '%::Freetext::%' OR Budget LIKE '%::Freetext::%' OR Budget_dist LIKE '%::Freetext::%' OR Sources LIKE '%::Freetext::%'))
0
hhammashCommented:
Hi Toni,

Try:

<% If (Trim(FP_FieldVal(fp_rs,"FieldName")) > 0) Then %>
Your long line comes here
<% End If %>

What do you want to get from your SQL.  It looks confusing?

Best regards
hhammash
0
tonikaramAuthor Commented:
Hi hhammash

Nevermind the sql, check out the example I gave. I want my search to be like Google:
if you search "Hi I am Tony" for the words Hi and Tony, you will not get anything except if the search is intelligent enough to search seperately for Hi, or Tony..
as if it is searching for Hi%Tony or Tony%Hi or Hi alone or Tony alone...
the sql is just a long sequence of LIKE statements.. forget it

The typemismatch is still there, but forget it, using asc <>38 seems enough to detect blank fields...

Tony
0
webwomanCommented:
>>I want my search to be like Google:

That's going to be pretty hard -- Google is VERY sophisticated.

Do you understand SQL/ASP enough to write your own code? It would allow for a lot more flexibility. For instance, you could see what was generated from one way of putting it together and if there weren't any results, try another option.  
0
tonikaramAuthor Commented:
Is implementing an OR so unreasonable?

I would think that this is a basic feature of any search to allow the existence of ANY of the words entered..
Isn't it very rare to see a search that doesn't OR the words?...

For instance, isn't there a code that could take each word, feed it into an array or some kind of buffer, and write the whole thing in a single select statement? For some reason I feel that this is something one could expect from asp/sql/frontpage...

It could be because I am new to all this
0
hhammashCommented:
Hi Toni,

You can do that without mentioning the Or hundred times in your query.

You want a text box to search the database,  you want to type something like Toni Karam and search then the results should display:
Toni Karam
Karam Toni
Toni
Karam

If this is what you need,  then:

1- Create a page called Search.asp
2- Create a page called results.asp

3- Open Search.asp
4- Insert a form with one field (in my example I inserted one search field and called it Country).  Open the form properties and post it to results.asp.  Then save the page.

5- Open results.asp
6- Insert Database results
7- In the criteria make it search for the field
8- Finish the DRW
9- Save it
10- After saving the DRW,  put it on diet (Spooky Diet)
11- Save it after putting it on diet.
12- Modify the code before the fp_sQry=.... as follows:

<%

DIM myArray, myQuerystring

myArray = split(Request("Country")," ") 'splitting on spaces
myQuerystring = "" 

FOR i = 0 to (uBound(myArray)-1)
myQuerystring = myQuerystring & "'" & myArray(i) & "',"
NEXT

'don't want a comma trailing the last one
myQuerystring = myQuerystring & "'" & myArray(ubound(myArray)) & "'"
response.write myQuerystring


response.write myQueryString

fp_sQry="SELECT * FROM Customers WHERE Country IN("&myQuerystring&")"
fp_sDefault="Country="

(Please note that I am receiving what is inside the Country search textbox which is on the form. You can change the country field in my example and put your search textbox name)

Save the page and search.

If you don't know how to put the code on diet just go to http://www.outfront.net/spooky/adv_drw_diet.htm

NOTES:
------
In my code only change the country field and put your search form field instead.

Don't put the DRW code on diet before saving it.  Save the DRW then put it on diet.

The search form and the result page have to be on different pages.

When you try the form type any text that you want.  It will behave like google.

Test my sample here:  Type in the textbox:I want to list USA and France only.

http://www.fmhs.uaeu.ac.ae/immconf/MultiSearchBox/SearchForm.asp

Best regards
hhammash



0
hhammashCommented:
0
tonikaramAuthor Commented:
Hi hhammash,

Yes I was going to tell you that IN doesn't work, it is LIKE that I need. From the link you gave me, the code that I need is at the bottom of this message, but I can't customize it... I get:

--------
Database Results Error
Description: Command text was not set for the command object.
Number: -2147217908 (0x80040E0C)
Source: Microsoft OLE DB Provider for ODBC Drivers
--------

Maybe you can help with that error.. here my modified code that caused it:
--------
<%
Dim Keyw
Dim myquery
Dim myQuerystring


Keyw = split(Request.Form("Nameenglish")," ")
myQuerystring = "(Nameenglish Like '%" & trim(Keyw(0)) & "%' " 

if uBound(Keyw) > 0 Then
for i = 1 to uBound(Keyw)
myQuerystring = myQuerystring & " OR (Nameenglish Like '%" & trim(Keyw(i)) & "%')"
next
end if

Keyw = "SELECT * FROM DRI WHERE ("

Keyw = Keyw + myQuerystring
Keyw = Keyw + ")) ORDER BY Nameenglish ASC"


myquery = Keyw
response.write (myquery & "<BR>")
%>
-------

But I get an error. What I need is to search TWO textboxes and a dropdown...


Here is the original code that I am interested in...
Thanks,
Tony

Dim Keyw
Dim SubC
Dim myquery
Dim myQuerystring
SubC = Request.form("SubCategory")
Keyw = Request.Form("Keyword")
if (Keyw = "" Or Keyw = " ") Then
if (SubC = "" Or SubC = " ") Then
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::') ORDER BY EQPSpecialPrice ASC"
else
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::' AND SubCategory= '::SubCategory::') ORDER BY EQPSpecialPrice ASC"
end if
else
Keyw = split(Request.Form("Keyword")," ")
myQuerystring = "(ItemName Like '%" & trim(Keyw(0)) & "%' " 
myQuerystring = myQuerystring & " Or Description Like '%" & trim(Keyw(0)) & "%')"
if uBound(Keyw) > 0 Then
for i = 1 to uBound(Keyw)
myQuerystring = myQuerystring & " OR (ItemName Like '%" & trim(Keyw(i)) & "%')"
myQuerystring = myQuerystring & " OR (Description Like '%" & trim(Keyw(i)) & "%')"
next
end if
if (SubC = "" OR SubC = " ") Then
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::' And ("
else
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::' And SubCategory= '::SubCategory::' AND ("
end if
Keyw = Keyw + myQuerystring
Keyw = Keyw + ")) ORDER BY EQPSpecialPrice ASC"
end if
myquery = Keyw
response.write (myquery & "<BR>")
0
hhammashCommented:
Hi Toni,

Obviously I still don't know what you are trying to do.


You have a search form with one textbox for search.(Right/Wrong)?
You have a resutls page to get the search criteria from the form. (Right/Wrong)?
You want to type Toni Karam in the search and get results for:
Toni Karam
Toni
Karam
(Right/Wrong)?
You have the form Separate from the Results page. (Right/Wrong)?

Please reply to those questions.


hhammash
0
hhammashCommented:
Hi Toni,

I read your first post more carefully:

You have a Dropdown and three TextBoxes:
What is the name of the drop down
what is the name of each of the textboxes.

Suppose you have those names:
MyDrop
MyText1
MyText2
MyText3

You want the SQL to do this:

Select from MyTable where MyField=MyDrop, Or MyField=MyText1, Or myField=MyText2, Or MyField=MyText3

So what you want is that you might use all search fields or leave some blank and get results.  Meaning you might select the DropDown only and leave the TextFields or put something in two textfields and leave the other parts of the form blank and still get results.

Is this what you need?

Why are you having a problem with "%".  Did you go to the default values in the DRW and put % as a default value?

Best regards
hhammash
0
tonikaramAuthor Commented:
Hi hhammash,

First thanks alot for your help.

Your last questions:
"- You want to type Toni Karam in the search and get results for:
Toni Karam
Karam Toni
Toni
Karam
(Right/Wrong)?"
absolutely right. the script that does a LIKE with OR's inside it (in my last message) was real close. The one you proposed with the IN statement worked great except that I need the LIKE.


"- You have the form Separate from the Results page. (Right/Wrong)?"
actually, having the search boxes still up there and the results down in a list on the SAME page would be ideal, but its ok if we have a restriction and cannot do it, I'll use the back button to re-search.


Ok, here is the full description.

page: search.asp
- textbox, called "Researcharea"
- textbox, called "Nameenglish"
- Dropdown, called Country
- another dynamic dropdown that automatically retreives the cities of the country selected above, from the database (but I am ok that we leave this for another question, lets ignore this dropdown, that is supposed to be called City).


++ what the user enters in textbox Researcharea will be searched in FOUR columns of the database. Names:
- Basic_sciences
- Applied_sciences
- Social_sciences
- Other_fields
the content of the researcharea should be part of the string present in ANY of the above four columns. That means this is an OR.

++ what the user enters in textbox Nameenglish will be searched in a column called Nameenglish. The names are long, so any string the user enters should search with LIKE (applies above also).

++ The Country dropdowned is retrieved from the column Country.

++ The City from the column City.



and here is the general logic. All textboxes that were filled, will be ANDed. That means that the user should leave some the textboxes blank, and still get results based on the other textboxes. But whatever he fills should be ANDed. The Countries dropdown also has a "All Countries" (value=%).


Basically, it is exactly what you said at the end. This post only contains the details (columns names etc).
Thanks,
Tony
0
hhammashCommented:
Hi,

You can use a two-frames window is you like and remove the borders,  they will look like one page.


Now,  from reading your last post I understand that you want your SQL to do this:

Select from TableName where FieldName = Researcharea and AppliedSciences or Researcharea and SocialSicences

So,  you mean that Researcharea is an essential part of the search but it has to be ANDed with either social sciences or Applied sciences.

If that is right:

We have to read of the AppliedSciences search box is empty then we search the other one and vise versa.  Is that correct.

Sorry to asking too much,  but it is becoming more clear now.

hhammash

p.s: Where are you from Toni?


0
tonikaramAuthor Commented:
hhammash, don't worry for too many qeustions on the contrary that makes it easier :)

No, let me clarify a bit:

the columns (or fields) on the access db that are of interest:
Nameenglish
Basic_sciences
Applied_sciences
Social_sciences
Other_fields

the searchboxes that will show in the form and that will search those columns:
Researcharea
Nameenglish

If Researcharea is not left blank, it will be do this:

1- SELECT * FROM DRI WHERE (Basic_sciences LIKE '%::Researcharea::%' OR Applied_sciences LIKE '%::Researcharea::%' OR Social_sciences LIKE  '%::Researcharea::%' OR Other_fields LIKE '%::Researcharea::%')

Putting many words in Researcharea should do an OR on these words (like discussed before)

If Nameenglish is not left blank, it will do this:

2- SELECT * FROM DRI WHERE (Nameenglish LIKE '%::Nameenglish::%')

Putting many words in Nameenglish should do an OR on these words (like discussed before)

If Country is not left on the "All Countries" option, it will do this:

3- SELECT * FROM DRI WHERE (Country LIKE '%::Country::%')


If Country dropdown is touched, and City dropdown is activated, and not left to the "All Cities" option, it will do this:

4- SELECT * FROM DRI WHERE (City LIKE '%::City::%')



Finally, queries 1- and 2- and 3- and 4-, should be AND'ed. an example:

A record from the database:

Nameenglish: Researchers and Energy Center
Basic_sciences: Energy studies
Applied_sciences: Field Recognition
Social_sciences: Surveys'n stuff
Other_fields: water, pollution and others
Country: Lebanon
City: Beirut

My query:

Researcharea: water desalination
Nameenglish: research middle east
Country: All Countries
City: inactive

I want the record to be returned.

Another query:
Researcharea: energy field
Nameenglish: blank
Country: Lebanon
City: All cities

the record must be returned.


Another query:
Researcharea: energy field
Nameenglish: Microsoft
Country: Lebanon
City: All cities

No results returned because there is not Microsoft in Nameenglish

Another Query:
Researcharea: survey
Nameenglish: blank
Country: Egypt
City: All Cities

No results because of the wrong country


I am from Beirut, Lebanon.
Thanks!
Tony

0
hhammashCommented:
Toni,

Would you please send me the ASP page (Search form by mail)to:
hhammash@uaeu.ac.ae

I should see it.

Thanks
hhammash
0
tonikaramAuthor Commented:
I sent it.

Tony
0
hhammashCommented:
Hi Toni,

I recieved it and will look into it.

hhammash
0
hhammashCommented:
Hi Toni,

I sent you the new folder zipped.  You can unzip it and you know how to make it work in IIS.

What I did was:

1- I made the 4 fields either all or it does not matter.
2- If the FreeText field is not empty, the database will search the FreeText field and ignor whatever is written in the other 4 fields.

please test it and let me know.

hhammash
0
hhammashCommented:
Hi,

When it works we will talk about the other matter.  Country and City drop downs.


hhammash
0
tonikaramAuthor Commented:
Hisham,

I took a look at it. What I need now in my search page is this:

- if I enter many words in the SAME text field (let's say country), the words are OR'ed. So if I enter "Jordan Kuwait", I receive all records in Jordan or Kuwait.

- I think FreeText should be treated like the others. i.e, if left blank, it is ignored, otherwise, it is AND'ed with the others (just like country, etc).

Tony
0
hhammashCommented:
Hi Toni,

I did it this way because you said in your post above that the first 4 should be AND'ed.  What I did was the if the FreeText is blank it will be ignored but if it is not blank the first 4 will be ignored.

So, you want FreeText to be dealt with as the others.  The problem here is FreetText logically should not be AND'ed, why?

Each of the other 4 fields will take certain information from the database. Example: if we select:
Country: Egypt
City: Giza
Name English: Almishkat
Name Arabic: blank

This will give 1 result.

If we use:
Country: Egypt
City: Giza
Name English: Almishkat
Name Arabic: blank
FreeText: Egypt Kuwait

This will give 0 results because you do not have a record that says

Egypt and Giza and Almishkat and Egypt or Kuwait.

This is why I left FreeText to be separate.  You can make all fields Like '%::FreeText::%'. In this case you can use it without the other fields.  


ANYWAY
-------
Copy this code which will make the Freetext field OR'ed.

copy it and replace the previous one:

DIM myArray, myQuerystring
myArray = split(Request.Form("FreeText")," ") 'splitting on spaces
myQuerystring = "'" & Request.Form("FreeText") & "',"
FOR i = 0 to (uBound(myArray)-1)
myQuerystring = myQuerystring & "'" & myArray(i) & "',"
NEXT
myQuerystring = myQuerystring & "'" & myArray(ubound(myArray)) & "'"
response.write myQuerystring

if request.form("FreeText") <>"" then
fp_sQry="SELECT * FROM DRI WHERE (Basic_sciences IN ("&myQuerystring&") OR Applied_sciences IN ("&myQuerystring&") OR Social_sciences IN ("&myQuerystring&") OR country IN ("&myQuerystring&") Or city IN ("&myQuerystring&") Or Other_fields IN ("&myQuerystring&"))"
Else
fp_sQry="SELECT * FROM DRI WHERE (Name_english LIKE '%::Name_english::%' AND Name_arabic LIKE '%::Name_arabic::%' AND Country LIKE '%::Country::%' AND City LIKE '%::City::%')"
end if


Put the code before this line:
fp_sDefault="Name_english=%&Name_arabic=%&Country=%&City=%"

Keep this line without changing.

Try it and if you still insist on having the FreeText AND'ed let me know.  But believe me if FreeText is AND'ed you will have problems with finding data.

Let me know
hhammash


0
hhammashCommented:
Hi Toni,

I tried to AND'ed FreeText, it works fine Codewise but resultswise it does not give any result.

In the code where I gave you above,  you can add all the fields you like to be searched by FreeText.  FreeText becomes a global search field separate from the above fields.

The issue is that when you fill more than one field of the top for Country, City, Name_english and Name_arabic you narrow your search and come closer to 1 record.  If you type anything in FreeText that does not relate to that record and AND'ed it,  you will get 0 results.  If you always OR the FreeText you will get many redundant results.

So here in the SQL if FreeText field is not blank you can add all the table fields,  in the example below I will use field names as addfield1 ...etc but you can replace them with fields from your table:
fp_sQry="SELECT * FROM DRI WHERE (Basic_sciences IN ("&myQuerystring&") OR Applied_sciences IN ("&myQuerystring&") OR Social_sciences IN ("&myQuerystring&") OR country IN ("&myQuerystring&") Or city IN ("&myQuerystring&") Or Other_fields IN ("&myQuerystring&")Or addfield1 IN ("&myQuerystring&")addfield2 IN ("&myQuerystring&")addfield3 IN ("&myQuerystring&"))"  ....etc.

In this way Whatever you type in Freetext will be searched for first for the whole senetence,  then the code will break the sentence according to the space.

If you type something like:

I want to find Almiskhat centre in the database,  you will get 1 record.

Keep FreeText as a separate Unit and don't worry,  when it is not empty the first 4 fields will be ignored. You can modify your form to be like:

Search:
Country:
City:
English Name:
Arabic Name

Or do a free search here
Free Search:

So the user will now if he/she uses Free Search field they should leave the above fields blank.

Hope it helps
hhammash
0
hhammashCommented:
Hi Toni,

Small change.

Most only this line of code before the DIM and after the <%
this is the line:

if request.form("FreeText") <>"" then

If should look like
<% end if %>
<%
if request.form("FreeText") <>"" then

DIM myArray, myQuerystring
myArray = split(Request.Form("FreeText")," ") 'splitting on spaces
.......etc

without changing anything else.  Just cut this Line:
if request.form("FreeText") <>"" then

and put it before DIM.

Thanks
hhammash
0
tonikaramAuthor Commented:
Hhammash,

I see where your logic is coming from. Actually, you are right regarding freetext. I think it is the fact that I have 161 records that is making me want to AND freetext. And I had not explained to you about freetext before. As you pointed out, freetext will be tested against ALL the fields of the database (as in the zip file). Joining this with the fact that the dtabase has 161 records instead of the 15 I sent you, helps give results.

But as I said in my previous post, "if I enter many words in country, the words are OR'ed. So if I enter "Jordan Kuwait", I receive all records in Jordan or Kuwait", what I don't see is the array logic (splitting on spaces, OR'ing the many words) being applied on THESE textboxes also, not only on the freetext textbox:

- The research area textbox (the one that deals with Basic_sciences, Applied_sciences, Social_sciences and Other_fields);
- The Country textbox (the one that deals with the Country field;
- The Name_english textbox (dealing with the Name_english textbox).

Note that if country and city are dropdownboxes, then the only extra textboxes that will need an OR logic (array + splitting on spaces etc) is the Name_english field and the Research_area textfield.

Remember, what I want is that the user enters whatever he wants many words at once in all or most of the textboxes, and get results. That is, an OR on all those words, against their corresponding fields in the database...

Thank you
Tony
0
tonikaramAuthor Commented:
....

I am starting to think that it is impossible to OR the words within the same textbox...
nothing works.. what I need is the use of LIKE, not IN..
0
hhammashCommented:
Toni,

The IN acts like an OR. If you put something like:

Jordan Kuwait

The code will take is as 'Jordan','Kuwait'
then searches

Where Country=Jordan
or
country=Kuwait

It splits what is in the textfield.

But if you have a country with spaces like Syrian Arab Republic you will not find it.

Actually the array is gathering everything written in the field and ORing it.  If you are not comfortable with splitting words according to space,  we can split them according to comma, semi-color, AND.  But you have to put a note for users to separate there search criteria with a comma.

For instance:

Syrian Arab Republic, Kuwait,  Jordan

The code will find all the three countries.  Here I am talking about the FreeText Search.

But in the country field you have to put one country
In the name_english you have to put part of the name_english. If it is not an array it will AND it automatically.

To be sure again:

You have Country drop down which will take only one country
You have City drop down which will take only one country.
You have Name_english search field.  Here you want to type whatever you like right?  The problem is that you can do that,  but will get no results, why?  because when you search the first 4 fields you are accessing the physical record on your way in filling the fields,  the more fields you fill the more closer you are to the record.  But FreeText is different because it is connected to all fields and it is an array.

To solve your problem I will do this:  Even if I am doing the project for myself.

The first 4 fields to be specific.  if a user is looking for Almishkat in Egype , Giza he will not be interested in ANDing the FreeText because in all cases he will get 1 record.

Separate your form:  First section put the 4 fields for specific searching,  and down put the FreeText for arbitraty (multi word ) searching.  In fact the FreeText if it is connected to all fields it will be sufficient, it is as if you are ORing all the fields.

In the freetext I can put:
I want to find Almishkat Center either in Egypt or Lebanon.

What you will get is:
Almishkat Record
Everything about Egypt
Everything about Lebanon

So, the first 4 fields will be for narrowing the search and freetext will be for searchers who do not have a clue where to look.

Best regards
Hisham
0
tonikaramAuthor Commented:
....

I am starting to think that it is impossible to OR the words within the same textbox...
nothing works.. what I need is the use of LIKE, not IN..
0
tonikaramAuthor Commented:
....

I am starting to think that it is impossible to OR the words within the same textbox...
nothing works.. what I need is the use of LIKE, not IN..
0
tonikaramAuthor Commented:
sorry for the last extra 2 comments, I was reloading the page!
0
tonikaramAuthor Commented:
yes hhammash. ignoring the first four if freetext is filled, is a very viable alternative... It is also very natural and comfortable. I think I will use it.

But, what is worrying me more is the OR thing on the other fields.
As you said, Syrian Arab Republic is a perfect example.

If I enter "Lebanon Syria Jordan" I will get everything from Lebanon, everything from Jordan, but not Syrian Arab Republic! because the expression " IN ('blabla','example','etc')" does not support partial matching or wild characters etc.
What I mean is that ideally I want it to work like this:

instead of:
" IN ('blabla','example','etc')"
I want:
" IN ('%bla%','%'example%','%etc%')"

but SQL does not allow it, the IN clause does not support %, that is why, somehow, only LIKE will return "Syrian Arab Republic" when I ask for "Syria Jordan Lebanon"

and that applies to all my fields, all of them are long sentences, and they will never fit in a "IN ('..','..','..')" statement. It is a keyword search, bascially.

Thanks,
Tony
0
hhammashCommented:
Hi Toni,

It is as if you are reading my mind,  I am working now on
IN('%bla%','%bla%','%bla%')

I'll see and let you know

Best regards
hhammash
0
tonikaramAuthor Commented:
Thanks Hisham,

This code, taken from the link you gave me http://www.frontpagewebmaster.com/tm.asp?m=111335&appid=&p=&mpage=1&key=&language=&tmode=&smode=&s=#111335

is very close to what I might need...  I guess? because it is doing an OR LIKE on each word entered...

<%
Dim Keyw
Dim SubC
Dim myquery
Dim myQuerystring
SubC = Request.form("SubCategory")
Keyw = Request.Form("Keyword")
if (Keyw = "" Or Keyw = " ") Then
if (SubC = "" Or SubC = " ") Then
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::') ORDER BY EQPSpecialPrice ASC"
else
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::' AND SubCategory= '::SubCategory::') ORDER BY EQPSpecialPrice ASC"
end if
else
Keyw = split(Request.Form("Keyword")," ")
myQuerystring = "(ItemName Like '%" & trim(Keyw(0)) & "%' " 
myQuerystring = myQuerystring & " Or Description Like '%" & trim(Keyw(0)) & "%')"
if uBound(Keyw) > 0 Then
for i = 1 to uBound(Keyw)
myQuerystring = myQuerystring & " OR (ItemName Like '%" & trim(Keyw(i)) & "%')"
myQuerystring = myQuerystring & " OR (Description Like '%" & trim(Keyw(i)) & "%')"
next
end if
if (SubC = "" OR SubC = " ") Then
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::' And ("
else
Keyw = "SELECT * FROM SpecialsDatabase WHERE (ProductType= '::ProductType::' And SubCategory= '::SubCategory::' AND ("
end if
Keyw = Keyw + myQuerystring
Keyw = Keyw + ")) ORDER BY EQPSpecialPrice ASC"
end if
myquery = Keyw
response.write (myquery & "<BR>")
%>


Tony
0
hhammashCommented:
Hi Toni,

I have got what you want.

From the beginning

1- Create the search form
2- Insert 5 fields (Country,City,Name_english,Name_arabic and FreeText)
3- Save the form

4- Create the DRW, in the More option click on criteria and select Country Contains country, city contains city, ...etc.  Then click default values,  give each of the fields the % value then finish the DRW and do not add the search form.  Save your page.  Put it on diet, then save it.

Now open your page and put this code above the fp_sQry..etc.

--------------------------------------------------
If request.form("FreeText")<>"" Then

DIM myArray, myQuerystring
myArray = split(Request.Form("FreeText")," ") 'splitting on spaces
myQuerystring = "(Country LIKE '%" & trim(myArray(0)) & "%')"
IF uBound(myArray) > 0 THEN
FOR i = 1 to uBound(myArray)
myQuerystring = myQuerystring & " Or (Country LIKE '%" & trim(myArray(i)) & "%')"
NEXT
End if
fp_sQry="SELECT * FROM DRI WHERE " & myQuerystring
Else
fp_sQry="SELECT * FROM DRI WHERE (Name_english LIKE '%::Name_english::%' AND Country LIKE '%::Country::%' AND City LIKE '%::City::%' AND Name_arabic LIKE '%::Name_arabic::%')"
End IF
fp_sDefault="Name_english=%&Country=%&City=%&Name_arabic=%"

---------------------------------------------------------

Notice that you fp_sFeaults should not be changed, I put the line here in order to show you where the code ends.  In the code above  where it says:
myQuerystring = myQuerystring & " Or (Country LIKE '%" & trim(myArray(i)) & "%')"

you can add all the fields that you want I put only country for testing.  It should be like
myQuerystring = myQuerystring & " Or (Country LIKE '%" & trim(myArray(i)) & "%')Or (City LIKE '%" & trim(myArray(i)) & "%')" ....etc.

It is working like a charm.  

So final logic is: The first 4 fields for narrowing the search then the last field FreeText is for free searching.

Best regards
hhammash
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wizzkiddCommented:
Having read your problem and scanned through everyone elses responses, I didn't see an answer what i though would be the most obvious reply.

The way in which I would try to solve this would be to store the searched string into an array.

searchWordsArray = Split(request.form("searchstring")," ")

then build an appropiate string of OR statements for preperation to enter into the SQL string:

searchField = "FreeText"
ORString = ""
For i = 0  to UBound(searchWordsArray)
  ORstring = ORstring & searchField & " = '" searchWordsArray(i) & "' OR "
Next
'remove the last unwanted <space>OR<space>
ORstring = Left(ORstring,len(ORstring)-4)

then you can put the ORstring into your SQL string where needed.

if i searched for "wizzkidd eats chicken" the ORstring would contain the following:
FreeText = 'wizzkidd' OR FreeText = 'eats' OR FreeText = 'chicken'

I hope that helps.

-WizzKidd
0
tonikaramAuthor Commented:
Hish,

I modified your script as follows (to get OR on Country and the others):

If request.form("Country")<>"" Then
If request.form("City")<>"" Then
If request.form("Name_english")<>"" Then

DIM myArrayCountry, myArrayCity, myArrayName_english, myQuerystringCountry, myQuerystringCity, myQuerystringName_english, myQuerystring
myArrayCountry = split(Request.Form("Country")," ") 'splitting on spaces
myQuerystringCountry = "(Country LIKE '%" & trim(myArrayCountry(0)) & "%')"
IF uBound(myArrayCountry) > 0 THEN
FOR i = 1 to uBound(myArrayCountry)
myQuerystringCountry = myQuerystringCountry & " Or (Country LIKE '%" & trim(myArrayCountry(i)) & "%')"
NEXT
End if

myArrayCity = split(Request.Form("City")," ") 'splitting on spaces
myQuerystringCity = "(City LIKE '%" & trim(myArrayCity(0)) & "%')"
IF uBound(myArrayCity) > 0 THEN
FOR i = 1 to uBound(myArrayCity)
myQuerystringCity = myQuerystringCity & " Or (City LIKE '%" & trim(myArrayCity(i)) & "%')"
NEXT
End if

myArrayName_english = split(Request.Form("Name_english")," ") 'splitting on spaces
myQuerystringName_english = "(Name_english LIKE '%" & trim(myArrayName_english(0)) & "%')"
IF uBound(myArrayName_english) > 0 THEN
FOR i = 1 to uBound(myArrayName_english)
myQuerystringName_english = myQuerystringName_english & " Or (Name_english LIKE '%" & trim(myArrayName_english(i)) & "%')"
NEXT
End if


myQuerystring = myQuerystringCountry & " AND (" & myquerystringCity & ") AND (" & myQuerystringName_english & ")"

End if
End if
End if

fp_sQry="SELECT * FROM DRI WHERE " & myQuerystring



Finally, I have an OR on Country, City, English_name. I removed freetext because it is not the priority now (and to be able to change the simpler script). The only problem is that I get this errors whenever I leave Country, City or English_name blank. I fairly think it is an easy error? but I am not knowing how to incorporate default values:

Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error in WHERE clause.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers

Tony
0
hhammashCommented:
Hi Toni,

So, you are trying now to make each field like free text but you will limit it to the field?

hhammash
0
tonikaramAuthor Commented:
hhammash,

I can't beleive what I am seeing. I modified the code you gave me some more, and the thing is........ WORKING!!!!!!!!

hhammash, YOU DA MAN!


here is the modified code. yes, I had to put "= 1" to allow for blanks in the SQL query, DON'T ASK ME WHY BUT IT WORKS! SQL is behaving like unix now! here is the code (more remarks at bottom):

DIM myArrayBasic_sciences, myArrayName_english, myArrayFreetext, myQuerystringBasic_sciences, myQuerystringName_english, myQuerystringFreetext, myQuerystring
If request.form("Basic_sciences")<>"" Then

myArrayBasic_sciences = split(Request.Form("Basic_sciences")," ") 'splitting on spaces
myQuerystringBasic_sciences = "(Basic_sciences LIKE '%" & trim(myArrayBasic_sciences(0)) & "%') OR (Applied_sciences LIKE '%" & trim(myArrayBasic_sciences(0)) & "%') OR (Social_sciences LIKE '%" & trim(myArrayBasic_sciences(0)) & "%') OR (Other_fields LIKE '%" & trim(myArrayBasic_sciences(0)) & "%')"
IF uBound(myArrayBasic_sciences) > 0 THEN
FOR i = 1 to uBound(myArrayBasic_sciences)
myQuerystringBasic_sciences = myQuerystringBasic_sciences & " Or (Basic_sciences LIKE '%" & trim(myArrayBasic_sciences(i)) & "%') OR (Applied_sciences LIKE '%" & trim(myArrayBasic_sciences(i)) & "%') OR (Social_sciences LIKE '%" & trim(myArrayBasic_sciences(i)) & "%') OR (Other_fields LIKE '%" & trim(myArrayBasic_sciences(i)) & "%')"
NEXT
End if
Else
myQuerystringBasic_sciences = 1
End if

If request.form("Name_english")<>"" Then

myArrayName_english = split(Request.Form("Name_english")," ") 'splitting on spaces
myQuerystringName_english = "(Name_english LIKE '%" & trim(myArrayName_english(0)) & "%')"
IF uBound(myArrayName_english) > 0 THEN
FOR i = 1 to uBound(myArrayName_english)
myQuerystringName_english = myQuerystringName_english & " Or (Name_english LIKE '%" & trim(myArrayName_english(i)) & "%')"
NEXT
End if
Else
myQuerystringName_english = 1
End if

myQuerystring = myQuerystringBasic_sciences & " AND (" & myQuerystringName_english & ") AND (Country LIKE '%::Country::%')"



fp_sQry="SELECT * FROM DRI WHERE " & myQuerystring


I am testing it heavily now, it might show problems, but till now it is ok. But i have one question. How do I record the number of hits????? I had a database region specially for saying how many results, it is obviously returning zero results when things get complicated now.

Tony
0
tonikaramAuthor Commented:
Yes, all fields are like freetext now, and limited to the field, except for Basic_sciences which is limited to a set of fields.

Tony
0
hhammashCommented:
Hi Toni,

Then try

<%
DIM ..........

If Field <>"" Then
Code
End if

for each field


The sequence you put is wrong.

hhammash
0
tonikaramAuthor Commented:
update :)

the count worked. I cut the whole dim and array script and pasted it before the place where I had the select count(*) statement, so now the counting is correct.

:)

I have one final problem before the question is closed, I will incorporate freetext.

Thanks for all,
Tony
0
hhammashCommented:
Hi Toni,

You can now add the FreeText in the same way but you have to include all the fields.

Regards
hhammash
0
tonikaramAuthor Commented:
Extremely weird

I have these two problems:
- My script is listing the results by groups of 50. But now after the complicated query, when I press next, the next page is from a blank query (i.e full results) cancelling my previous query. The temporary solution is to display all results in one page (each a row). with 161 results do you think that is reasonable for performance?

- If I leave a trailing space or a leading space in Name_english, but not Basic_sciences, then it gives an error:

Database Results Error: mismatched parameter delimitersName_english City Country
Database Results Error: mismatched parameter delimiters

Putting both a trailing and a leading space gives no error! (only on Name_english, Basic_sciences is ok throughout).

Tony
0
hhammashCommented:
Hi,

Did you trim all fields in your Code?

hhammash
0
hhammashCommented:
Hi,

161 Rows is too much for the user. You are right.

But why are you getting blank pages after the first one.

hhammash
0
tonikaramAuthor Commented:
hhammash,
trim problem solved.

Regarding the blank pages, no they are not blank. Let's say I have 3 pages for 110 results and displaying the first page. I press on next. I get "2 of 4". the results total got back to 161, and I am on page 2 of 4.

as if the search was done again, but with blank parameters.

I am extremely worried about customizing the page using frontpage (it will regenerate the code everytime). will putting the page on diet solve this? I need to change the table width, the font, format etc!

Thanks,
Tony
0
hhammashCommented:
Hi Toni,

Is it possible to post the link?

hhammash
0
tonikaramAuthor Commented:
Hi hhammash,

No, I am thinking about uploading it to my geocities but I am not sure it will work... global.asa should be in the same dir, right?

anyway I dieted the page, and am testing changing its format through frontpage to see whether it will change the page.
Thanks,
Tony
0
tonikaramAuthor Commented:
sorry, one of the last questions, but the reset button doesn't work except on the first page...

why could that be..
0
tonikaramAuthor Commented:
Hi hhammash. I posted the question
Thanks,
Tony
0
hhammashCommented:
Hi Toni,

The reset button will work on the first one only.

What it the news about the original question.  Is it working now?

hhammash
0
hhammashCommented:
Hi Toni,

Why do you want Country and City fields to be included in the code since they are going to be Drop Downs and will have values in them.  So, the If request.form("Country")<>"" will not be necessary.

Believe me Toni, the best solutions which is professioanl too is to make the first 4 to narrow the search and keep FreeText to search alll fields using the code.

What is the use of having two countries in the country field.  Also you are going to make them drop down menues.

Best regards
hhammash
0
tonikaramAuthor Commented:
Hi hhammash,

Technically, the freetext thing is working bothways (seperate from others, or anded to others). I will ask the people that want the db on the web what is their preference (they wanted that originally).

Country and City are not included in this multiple word, array-OR thing. The Country field is a dropdown. And the City field is not included in the search yet.

I am looking on solving the problem with the previous/next buttons. I think I know why, they were originally generated by frontpage, and are looking for the original scripts'n stuff, those that were replaced by the sophisticated query. I will look into making them work and we close the question.


Thanks for all,
Tony
0
hhammashCommented:
Hi Toni,

Just let me know.

hhammash
0
tonikaramAuthor Commented:
I couldn't determine why frontpage's next and previous buttons behave like that, but that is a sceondary problem, solved by displaying all results in one page, and anyway what was achieved here is more, more, much more than originally hoped forand the effort put in here to assist me is beyond what to be expected in the context of internet forums.
isn't this thread the longest on experts-exchange?.. should be

Anyway thanks hhammash,
Tony
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.