I'm pullin my hair out here with a search and results function...
I have a search form on every page including the search results page:
<form name="frmSearch" action="searchResults.asp" method="post">
<input name="txtSearch" type="text" class="boxlook" id="txtSearch" value="search" size="14" onFocus="this.value=''">
<input name="btnSubmit" value="Submit" type="image" src="images/arrow2.gif">
</form>
The code on the search results page is:
<%
Dim SearchString
SearchString = ""
SearchString = Request.Form("frmSearch")
%>
<%
Dim rstResults
Dim rstResults_numRows
Set rstResults = Server.CreateObject("ADODB.Recordset")
rstResults.ActiveConnection = MM_conn_STRING
rstResults.Source = "SELECT * FROM Companies WHERE comName LIKE '%" & SearchString & "%'"
rstResults.CursorType = 0
rstResults.CursorLocation = 2
rstResults.LockType = 1
rstResults.Open()
rstResults_numRows = 0
%>
No matter what is entered in the search box though, the same record (the first) is displayed every time.... I've probably overlooked something really simple but I can't see it... I've been staring at this for hours!!
Please help...