Could anyone please tell me what is wrong with my code.<BR><BR>It is suppose to run an sql statement from input on another page, but when it is run the resulting recordset shows all records rather than the ones I would expect.<BR><BR><BR>&#060;%@ Language="VBScript" %&#062;<BR>&#060;html&#062;<BR><BR>&#060;head&#062 ;<BR>&#060;title&#062;Help In Hand Text Search&#060;/title&#062;<BR>&#060;/head&#062;<BR>&#060;%<BR>DIM sqlstring<BR><BR>Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")<BR>Connstr ing = "DSN=*********;UID=*************;PWD=**********"<B R>dbGlobalWeb.open (Connstring)<BR><BR>sqlstring ="SELECT * FROM [Organisations]"<BR><BR>If Request.Form("TypeSearch") = "Location1" Then<BR>sqlstring = sqlstring & " WHERE [Locations1] LIKE &#039%"& Request.Form("Locations") & "%&#039" <BR>End if<BR><BR>If Request.Form("TypeSearch") = "Location2" Then<BR>sqlstring = sqlstring & " WHERE [Locations2] LIKE &#039%"& Request.Form("Locations") & "%&#039" <BR>End if<BR><BR>If Request.Form("TypeSearch") = "Location3" Then<BR>sqlstring = sqlstring & " WHERE [Locations3] LIKE &#039%"& Request.Form("Locations") & "%&#039" <BR>End if<BR><BR>If Request.Form("TypeSearch") = "Location4" Then<BR>sqlstring = sqlstring & " WHERE [Locations4] LIKE &#039%"& Request.Form("Locations") & "%&#039" <BR>End if<BR><BR>If Request.Form("TypeSearch") = "Location5" Then<BR>sqlstring = sqlstring & " WHERE [Locations5] LIKE &#039%"& Request.Form("Locations") & "%&#039" <BR>End if<BR><BR>If Request.Form("TypeSearch") = "Organisation" Then<BR>sqlstring = sqlstring & " WHERE [Organisation] LIKE &#039%"& Request.Form("Locations") & "%&#039" <BR>End if<BR><BR>If Request.Form("TypeSearch") = "Premesis_Address" Then<BR>sqlstring = sqlstring & " WHERE [Premesis_Address_Line_1] LIKE &#039%"& Request.Form("Locations") & "%&#039" <BR>End if<BR><BR>Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")<BR>rsGlobal Web.Open sqlstring, dbGlobalWeb, 3, 3<BR><BR>%&#062;<BR><BR>&#060;body bgcolor="white"&#062;<BR>&#060;% if rsGlobalWeb.eof then %&#062;<BR>&#060;b&#062;<BR><BR>&#060;p&#062;The re Are Currently No Results To Your Search. &#060;/b&#062;&#060;% Else %&#062; &#060;%if not rsGlobalWeb.bof then %&#062; &#060;/p&#062;<BR><BR>&#060;h2&#062;Here are the results of your search:&#060;/h2&#062;<BR>&#060;%do while not rsGlobalWeb.EOF%&#062;<BR><BR>&#060;table BGCOLOR="white" border="5" width="75%" cellpadding="1"&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Organisation&#060;/b&#062; &#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Organisa tion")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Contact Name&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Contact_ Name")& " or " & rsGlobalWeb.fields("Second_Contact_Name")%&#062;<B R>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Contact Position&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Contact_ Position")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Telephone Number&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Corresp_ Tel_no")& " or " & rsGlobalWeb.Fields("Second_Contact_Tel_no")%&#062; <BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Fax / E-Mail&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Corresp_ Fax_no")& " or " & rsGlobalWeb.Fields("E_mail_address")%&#062;<BR>&#0 60;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Contact Address&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Corresp_ Address_line_1")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;*&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Corresp_ Address_line_2")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;*&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Corresp_ Address_line_3")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;*&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Corresp_ Address_line_4")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;PostCode&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Corresp_ Post_Code")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Description&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Descript ion")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Premises&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Premises _Address_line_1")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;*&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Premises _Address_line_2")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;*&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Premises _Address_line_3")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;*&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Premises _Address_line_4")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Opening Times&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Opening_ Times")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Meetings&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Meetings ")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Activities&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Activiti es")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Disabled Access&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%="Wheelchair Access :-" & rsGlobalWeb.Fields("Wheelchair_Access")& " or " & "Disabled Toilets :-" & rsGlobalWeb.fields("Disabled_Toilets")%&#062;<BR>& #060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Languages Spoken&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Language s")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Publications&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Publicat ions")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;&#060;font SIZE="2"&#062;&#060;b&#062;Date Record Updated&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR> &#060;td&#062;&#060;%=rsGlobalWeb.Fields("Date_upd ated")%&#062;<BR>&#060;/td&#062;<BR> &#060;/tr&#062;<BR>&#060;/table&#062;<BR><BR>&#060;hr&#062;<BR><BR>&#060;hr& #062;<BR>&#060;%rsGlobalWeb.MoveNext%&#062;<BR>&#0 60;%if not rsGlobalWeb.eof then %&#062;<BR>&#060;button&#062;<BR><BR>&#060;p&#062; Next Record&#060;/button&#062;&#060;%else%&#062;&#060;button&#062;No More Records&#060;/button&#062;&#060;%end if%&#062; &#060;/p&#062;<BR>&#060;%loop%&#062;<BR>&#060;%End if%&#062;<BR>&#060;%End if%&#062;<BR>&#060;%<BR>rsGlobalWeb.close<BR>dbGlo balWeb.close<BR>%&#062;<BR><BR>&#060;form NAME="goback"&#062;<BR> &#060;p&#062;&#060;input TYPE="Button" VALUE="Go Back" onclick="go_back()"&#062; &#060;/p&#062;<BR>&#060;/form&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR>&#060;script LANGUAGE="JavaScript"&#062;<BR><BR>function go_back()<BR>{ <BR>location.href="../SearchPage.asp";<BR>} <BR> <BR>&#060;/script&#062;<BR><BR><BR>Please help, this is my first real asp project and hopefully not my last.<BR><BR>Gary J.<BR><BR>