Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default .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>&nbsp;</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

  2. Similar Questions and Discussions

    1. 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. ...
    2. 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...
    3. 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,...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default Re: .asp Search Problem

    Thanks - I knew it was something simple.
    DeanoClarke Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139