Solved

How do I get my Dreamweaver 8 ASP search/results page to search more than once?

Posted on 2008-10-07
5
389 Views
Last Modified: 2012-05-05
I have created a search/results web page for my company intranet. Everything is working fine except that you can only search the database one time. When you try to search again, "this page cannot be displayed" is returned. My code is below. Any help is greatly appreciated.
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/TechRes.asp" -->
<%
var rsTechRes__MMColParam = "1";
if (String(Request.QueryString("textfield")) != "undefined" && 
    String(Request.QueryString("textfield")) != "") { 
  rsTechRes__MMColParam = String(Request.QueryString("textfield"));
}
%>
<%
var rsTechRes = Server.CreateObject("ADODB.Recordset");
rsTechRes.ActiveConnection = MM_TechRes_STRING;
rsTechRes.Source = "SELECT ScannedDocument, ChaptersWithinBook, BookORMag, link, Images FROM Books WHERE ChaptersWithinBook LIKE '%"+ rsTechRes__MMColParam.replace(/'/g, "''") + "%' ORDER BY ScannedDocument ASC";
rsTechRes.CursorType = 1;
rsTechRes.CursorLocation = 1;
rsTechRes.LockType = 1;
rsTechRes.Open();
var rsTechRes_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
rsTechRes_numRows += Repeat1__numRows;
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Technical Research Results</title>
<style type="text/css">
<!--
.style1 {
	font-family: "Arial Narrow";
	font-size: 36px;
	color: #990000;
}
.style59 {color: #990000}
.style60 {
	font-family: "Arial Narrow";
	font-size: 14px;
}
-->
</style>
</head>
 
<body>
<p align="center"><img src="Photos/TechResourceSearch.jpg" width="290" height="190" align="middle" /><span class="style1"> Technical Research Database </span></p>
<table width="820" border="0" align="center" cellpadding="1">
  <tr>
    <td width="201"><div align="left"><a href="http://norton/eng/engineering/enghome.html"><img src="Bullets/EngHomePage.jpg" width="200" height="24" border="0" /></a></div></td>
    <td width="200"><div align="center"><a href="http://norton/"><img src="Bullets/Intranet-home.jpg" width="200" height="24" border="0" /></a></div></td>
    <td width="200"><div align="center"><a href="http://www.isateceng.com"><img src="Bullets/Isatec-website.jpg" width="200" height="24" border="0" /></a></div></td>
    <td width="201"><div align="left"><a href="http://www.ccioh.com"><img src="Bullets/CCI-website.jpg" width="200" height="24" border="0" /></a></div></td>
  </tr>
</table>
<p align="center" class="style60">&nbsp;</p>
<form id="form1" name="form1" method="get" action="EngResResults.asp">
  <p align="center">New Keyword
    <input type="text" name="textfield" />
      <input type="submit" name="Submit" value="Search" />
  </p>
</form>
<p align="center">&nbsp;</p>
<table width="630" border="1" align="center" cellpadding="1">
  <tr>
    <td width="620"><p align="center" class="style60">To view all documents in this database you can go to P:\eng\ScannedBooks or <a href="ScannedBooks\ListOfDocuments.xls" target="_blank" class="style59">click here</a> for a list of all documents.</p>
    <p align="center" class="style60">If you would like to add research material to this database, or if you are having problems, please contact Stephanie Klomstad. </p></td>
  </tr>
</table>
<p>&nbsp;</p>
<p align="center">
  <% if (rsTechRes.EOF && rsTechRes.BOF) { %>
  <strong>No Matches Found</strong>
  <% } // end rsTechRes.EOF && rsTechRes.BOF %>
</p>
<div align="left">
<% while ((Repeat1__numRows-- != 0) && (!rsTechRes.EOF)) { %>
    <table width="908" border="0" align="center" cellpadding="1">
      <tr>
        <th width="105" rowspan="5" align="left" valign="top" bordercolor="#000000" scope="col"><a href="<%=(rsTechRes.Fields.Item("link").Value)%>" target="_blank"><img src="<%=(rsTechRes.Fields.Item("Images").Value)%>" alt="" width="100" border="0" /></a></th>
        <th width="793" scope="col"><div align="left"><%=(rsTechRes.Fields.Item("ScannedDocument").Value)%></div></th>
      </tr>
      <tr>
        <td><div align="left"><%=(rsTechRes.Fields.Item("ChaptersWithinBook").Value)%></div></td>
      </tr>
      <tr>
        <td><div align="left"><%=(rsTechRes.Fields.Item("BookORMag").Value)%></div></td>
      </tr>
      <tr>
        <td><div align="left"><a href="<%=(rsTechRes.Fields.Item("link").Value)%>" target="_blank">Link</a></div></td>
      </tr>
      <tr>
        <td><div align="left"></div></td>
      </tr>
    </table>
    <%
  Repeat1__index++;
  rsTechRes.MoveNext();
}
%>
</div>
<p align="center">&nbsp;</p>
</body>
</html>
<%
rsTechRes.Close();
%>

Open in new window

0
Comment
Question by:sklomstad
  • 3
5 Comments
 
LVL 5

Expert Comment

by:Devario Johnson
ID: 22661347
can you post the contents of

EngResResults.asp

and

Connections/TechRes.asp
0
 
LVL 5

Expert Comment

by:Devario Johnson
ID: 22661394
can you post the contents of

EngResResults.asp

and

Connections/TechRes.asp
0
 

Author Comment

by:sklomstad
ID: 22662777
The previous is the EngResResults.asp page. Here is the Connections/TechRes.asp:


<%
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO" 
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_TechRes_STRING = "dsn=TechRes;"
%>

Open in new window

0
 
LVL 5

Accepted Solution

by:
Devario Johnson earned 500 total points
ID: 22733695
ahhh after looking at your code you have an empty if statement at the top and no closing ... check it out
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Html CheckBox obtain Its Value 5 36
Time comparison asp 1 20
Update the value of table B with value of table A tables inner join 6 75
Display field if column exists 7 33
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question