Ask a Question related to Dreamweaver AppDev, Design and Development.
-
DeanoClarke #1
.asp Search Problem
Hi There
I am currently trying to learn .asp with Dreamweaver. I am trying to create a
simple search, I have created a html form and a separate results page (I have
followed the tutorial within Dreamweaver on this subjetct).
On the results page I have created a recordset with a filter basically telling
the page to display results that have been passed from the form. Within the
recordset properties, when you click on Test and input a value - it works,
however when I display the recordset and apply a repeat region and test it, it
displays no records.
I have attached the code for both the search page and the results page.
Help!!
This is the search page - obviously
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="searchresults.asp" method="get" name="searchbox" >
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
This is the results page
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connTrio.asp" -->
<%
Dim rs_results__MMColParam
rs_results__MMColParam = "1"
If (Request.QueryString("searchbox") <> "") Then
rs_results__MMColParam = Request.QueryString("searchbox")
End If
%>
<%
Dim rs_results
Dim rs_results_numRows
Set rs_results = Server.CreateObject("ADODB.Recordset")
rs_results.ActiveConnection = MM_connTrio_STRING
rs_results.Source = "SELECT * FROM COMMENTS WHERE PRODUCT_MANF = '" +
Replace(rs_results__MMColParam, "'", "''") + "'"
rs_results.CursorType = 0
rs_results.CursorLocation = 2
rs_results.LockType = 1
rs_results.Open()
rs_results_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs_results_numRows = rs_results_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
-->
</style>
</head>
<body>
<p> </p>
<table border="1">
<tr>
<td>PRODUCT_ID</td>
<td>PRODUCT_MANF</td>
<td>PRODUCT_MODEL</td>
<td>PRODUCT_CATEGORY</td>
<td>PRODUCT_DESC</td>
<td>PRODUCT_PRICE</td>
<td>PRODUCT_STOCK</td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT rs_results.EOF)) %>
<tr>
<td><%=(rs_results.Fields.Item("PRODUCT_ID").Value )%></td>
<td><%=(rs_results.Fields.Item("PRODUCT_MANF").Val ue)%></td>
<td><%=(rs_results.Fields.Item("PRODUCT_MODEL").Va lue)%></td>
<td><%=(rs_results.Fields.Item("PRODUCT_CATEGORY") .Value)%></td>
<td><%=(rs_results.Fields.Item("PRODUCT_DESC").Val ue)%></td>
<td><%=(rs_results.Fields.Item("PRODUCT_PRICE").Va lue)%></td>
<td><%=(rs_results.Fields.Item("PRODUCT_STOCK").Va lue)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_results.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
rs_results.Close()
Set rs_results = Nothing
%>
DeanoClarke Guest
-
Verity Search Problem
I think that a verity search collection that was established on my server became corrupt. I deleted the collection and then tried to recreate it. ... -
Search Engine problem
hello i'm new in flex and have this problem i'm trying to make a search engine. i bind a datagrid to a text area where it shows information of a... -
Search panel - Problem MX->8
I want to set regular explession directly into search window, but searchParams doesnt work. Window checks only "Regular oxpression" ON, that is OK,... -
ASP Search Problem
Hi, wonder if anyone can help me with this - This was originally a simple search routine returning results back to itself! Trying to be smart I... -
Search Problem
How does the "Search Companion" works when you search "a word or phrase in the file"? It looks like I simply don't know how to use it or... -
Julian Roberts #2
Re: .asp Search Problem
Your input box needs to be named searchbox, to match that in your search
code. ie
<input type="text" name="searchbox">
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-



Reply With Quote

