Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2004, 05:05 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Added new search field & showing no results??

Hi All,
    I am working on adding to this script search fields for dates (dd/mm/yyyy). I get no errors but i also get no records returned. There should be several hundred. Can you please suggest to me what could be the wrong in the new code. I have placed all new code added in bold. (VBScript)



<%
Dim tfm_orderby, tfm_order
tfm_orderby = "sold_price"
tfm_order = "ASC"
If(CStr(Request.QueryString("tfm_orderby")) <> "") Then
    tfm_orderby = Cstr(Request.QueryString("tfm_orderby"))
End If
If(Cstr(Request.QueryString("tfm_order")) <> "") Then
    tfm_order = Cstr(Request.QueryString("tfm_order"))
End If

Dim sql_orderby
sql_orderby = " " & tfm_orderby & " " & tfm_order
%>
<%
Dim rsResults__varConstruction
rsResults__varConstruction = "%"
if (Request.QueryString("menuConstruction") <> "") then rsResults__varConstruction = Request.QueryString("menuConstruction")
%>
<%
Dim rsResults__varCounty
rsResults__varCounty = "%"
if (Request.QueryString("menuCounty") <> "") then rsResults__varCounty = Request.QueryString("menuCounty")
%>

<%
Dim rsResults__varProperty_type
rsResults__varProperty_type = "%"
if (Request.QueryString("menuProperty_type") <> "") then rsResults__varProperty_type = Request.QueryString("menuProperty_type")
%>

<%
Dim rsResults__varFoundation
rsResults__varFoundation = "%"
if (Request.QueryString("menuFoundation") <> "") then rsResults__varFoundation = Request.QueryString("menuFoundation")
%>


<%
Dim rsResults__sql_orderby
rsResults__sql_orderby = "sold_price"
if (sql_orderby <> "") then rsResults__sql_orderby = sql_orderby
%>




<%
Dim rsResults__varKeywords
rsResults__varKeywords = "%"
if (Request.QueryString("menuKeywords") <> "") then rsResults__varKeywords = Request.QueryString("menuKeywords")
%>
<%
Dim rsResults__varGrantor
rsResults__varGrantor = "%"
if (Request.QueryString("menuGrantor") <> "") then rsResults__varGrantor = Request.QueryString("menuGrantor")
%>
<%
Dim rsResults__varGrantee
rsResults__varGrantee = "%"
if (Request.QueryString("menuGrantee") <> "") then rsResults__varGrantee = Request.QueryString("menuGrantee")
%>

<%
Dim rsResults__varNotes
rsResults__varNotes = "%"
if (Request.QueryString("menuNotes") <> "") then rsResults__varNotes = Request.QueryString("menuNotes")
%>

<%
Dim rsResults__varGMD
rsResults__varGMD = "%"
if (Request.QueryString("menuGMD") <> "") then rsResults__varGMD = Request.QueryString("menuGMD")
%>
<%
Dim rsResults__varSubdivision
rsResults__varSubdivision = "%"
if (Request.QueryString("menuSubdivision") <> "") then rsResults__varSubdivision = Request.QueryString("menuSubdivision")
%>
<%
Dim rsResults__varCity
rsResults__varCity = "%"
if (Request.QueryString("menuCity") <> "") then rsResults__varCity = Request.QueryString("menuCity")
%>

<%
Dim rsResults__varMinprice
rsResults__varMinprice = "0"
if (Request.QueryString("menuMinprice") <> "") then rsResults__varMinprice = Request.QueryString("menuMinprice")
%>
<%
Dim rsResults__varMaxprice
rsResults__varMaxprice = "0"
if (Request.QueryString("menuMaxprice") <> "") then rsResults__varMaxprice = Request.QueryString("menuMaxprice")
%>
<%
Dim rsResults__varMinacres
rsResults__varMinacres = "0"
if (Request.QueryString("menuMinacres") <> "") then rsResults__varMinacres = Request.QueryString("menuMinacres")
%>
<%
Dim rsResults__varMaxacres
rsResults__varMaxacres = "0"
if (Request.QueryString("menuMaxacres") <> "") then rsResults__varMaxacres = Request.QueryString("menuMaxacres")
%>
<%
Dim rsResults__varMinGLA
rsResults__varMinGLA = "0"
if (Request.QueryString("menuMinGLA") <> "") then rsResults__varMinGLA = Request.QueryString("menuMinGLA")
%>
<%
Dim rsResults__varMaxGLA
rsResults__varMaxGLA = "0"
if (Request.QueryString("menuMaxGLA") <> "") then rsResults__varMaxGLA = Request.QueryString("menuMaxGLA")
%>
<%
Dim rsResults__varMinAge
rsResults__varMinAge = "0"
if (Request.QueryString("menuMinAge") <> "") then rsResults__varMinAge = Request.QueryString("menuMinAge")
%>
<%
Dim rsResults__varMaxAge
rsResults__varMaxAge = "0"
if (Request.QueryString("menuMaxAge") <> "") then rsResults__varMaxAge = Request.QueryString("menuMaxAge")
%>

<%
Dim rsResults__varDate1
rsResults__varDate1 = "0"
if (Request.QueryString("menuDate1") <> "") then rsResults__varDate1 = Request.QueryString("menuDate1")
%>
<%
Dim rsResults__varDate2
rsResults__varDate2 = "0"
if (Request.QueryString("menuDate2") <> "") then rsResults__varDate2 = Request.QueryString("menuDate2")
%>


<%
set rsResults = Server.CreateObject("ADODB.Recordset")
rsResults.ActiveConnection = MM_connBusDirectory_STRING
rsResults.Source = "SELECT * FROM improved_data WHERE approved = yes AND construction like '" + Replace(rsResults__varConstruction, "'", "''") + "' AND county like '" + Replace(rsResults__varCounty, "'", "''") + "' AND property_type like '" + Replace(rsResults__varProperty_type, "'", "''") + "' AND foundation like '" + Replace(rsResults__varFoundation, "'", "''") + "' AND Address_1 like '%" + Replace(rsResults__varKeywords, "'", "''") + "%' AND grantor like '%" + Replace(rsResults__varGrantor, "'", "''") + "%' AND grantee like '%" + Replace(rsResults__varGrantee, "'", "''") + "%' AND additional_notes like '%" + Replace(rsResults__varNotes, "'", "''") + "%' AND gmd like '%" + Replace(rsResults__varGMD, "'", "''") + "%' AND subdivision like '%" + Replace(rsResults__varSubdivision, "'", "''") + "%' AND post_town like '%" + Replace(rsResults__varCity, "'", "''") + "%' AND sold_price >= " + Replace(rsResults__varMinprice, "'", "''") + " AND sold_price1 <= " + Replace(rsResults__varMaxprice, "'", "''") + " AND acres >= " + Replace(rsResults__varMinAcres, "'", "''") + " AND acres1 <= " + Replace(rsResults__varMaxacres, "'", "''") + " AND gla >= " + Replace(rsResults__varMinGLA, "'", "''") + " AND gla1 <= " + Replace(rsResults__varMaxGLA, "'", "''") + " AND year_built >= " + Replace(rsResults__varMinAge, "'", "''") + " AND year_built1 <= " + Replace(rsResults__varMaxAge, "'", "''") + " AND deeddate <= " + Replace(rsResults__varDate1, "'", "''") + " AND deeddate1 <= " + Replace(rsResults__varDate2, "'", "''") + " ORDER BY " + Replace(rsResults__sql_orderby, "'", "''") + ""
rsResults.CursorType = 0
rsResults.CursorLocation = 2
rsResults.LockType = 3
rsResults.Open ()
rsResults_numRows = 0
%>

<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rsResults_numRows = rsResults_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

and so on.......

Thanks in advance for viewing!









Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get texboxes data & added from table dynami venkatmakkena C# 0 August 2nd, 2006 06:41 AM
How do I display search results... aspiretech9 PHP How-To 1 April 26th, 2005 10:12 AM
how to added a calculated field in pivot table ndenhere BOOK: Access 2003 VBA Programmer's Reference 0 May 27th, 2004 02:45 AM
how to search on multiple sites and showing result cyberviral Classic ASP Basics 0 March 23rd, 2004 09:08 AM
Customize Search Results bmains ASP.NET 1.0 and 1.1 Professional 4 January 15th, 2004 08:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.