Print Page | Close Window

how to create multiple search page

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1172
Printed Date: 28 March 2026 at 11:06pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: how to create multiple search page
Posted By: squalleonhart
Subject: how to create multiple search page
Date Posted: 20 March 2003 at 10:22am

i have a problem to create a multiple search page, for ur all info. i want to create the search page like this...

i want to search the data from table car

n i can search by select the car make, car year, and car price

n for car price, i divide it into 5 categories

ANY = BETWEEN 1 AND 250000
under 20000 = BETWEEN 1 AND 19999
20000-50000 = BETWEEN 20000 AND 49999
50000-100000 = BETWEEN 50000 AND 99999
ABOVE 100000 = BETWEEN 100000 AND 250000

n this is my SQL that i create b4

SELECT *
FROM Car
WHERE Price MMColParam AND Make = 'Make' AND Year = 'Car_Year'
ORDER BY Price ASC

any solution 4 this problem...




Replies:
Posted By: michael
Date Posted: 20 March 2003 at 10:42am

strSQL = "Select * from car where Make = '" & Make & "' AND YEAR = '" & YEAR "' AND (Price " & MMColParam & ")"
Now MMColParam needs to post something like BETWEEN 1 AND 19999



Posted By: squalleonhart
Date Posted: 24 March 2003 at 5:30am

i used this coding(above) but the error still occurs...

can someone edit my coding here..

this one, coding for search page

<mailto:%@LANGUAGE="VBscript"%'>%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/concartrader.asp" -->
<%
Dim search
Dim search_numRows

Set search = Server.CreateObject("ADODB.Recordset")
search.ActiveConnection = MM_concartrader_STRING
search.Source = "SELECT * FROM Car"
search.CursorType = 0
search.CursorLocation = 2
search.LockType = 1
search.Open()

search_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>E-Car Trader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="64%"  border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td width="90%" colspan="2"><img src="images/hr_top.gif" width="449" height="22"></td>
    <td width="10%" rowspan="9">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#0099FF"> <div align="left"></div>
      <strong><font face="Harpoon">Search Advance</font></strong></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#ADD0FF">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#D9E9FF"><form action="result.asp" method="post" name="search1" id="search1">
        <table width="100%" border="0">
          <tr>
            <td>Make:</td>
            <td><select name="Make" id="Make">
                <option value="Alfa">Alfa</option>
                <option value="Audi">Audi</option>
                <option value="BMW">BMW</option>
                <option value="Citroen">Citroen</option>
                <option value="Daihatsu">Daihatsu</option>
                <option value="Ferrari">Ferrari</option>
                <option value="Fiat">Fiat </option>
                <option value="Ford">Ford </option>
                <option value="Honda">Honda</option>
                <option value="Hyundai">Hyundai</option>
                <option value="Isuzu">Isuzu</option>
                <option value="Jaguar">Jaguar</option>
                <option value="Kia">Kia</option>
                <option value="Lotus">Lotus</option>
                <option value="Mazda">Mazda</option>
                <option value="Merz">Merz</option>
                <option value="Mitusbishi">Mistubishi</option>
                <option value="Nissan">Nissan</option>
                <option value="Opel">Opel</option>
                <option value="Pegeout">Pegeout</option>
                <option value="Perodua">Perodua</option>
                <option value="Porsche">Porsche</option>
                <option value="Proton" selected>Proton</option>
                <option value="Renault">Renault</option>
                <option value="Suzuki">Suzuki</option>
                <option value="Toyota">Toyota</option>
                <option value="Volvo">Volvo</option>
                <option value="Volkswagen">Volkswagen</option>
              </select></td>
            <td>ex: Proton</td>
          </tr>
          <tr>
            <td>Year: </td>
            <td><select name="Car_Year" id="Car_Year">
                <option value="1980" selected>1980</option>
                <option value="1981">1981</option>
                <option value="1982">1982</option>
                <option value="1983">1983</option>
                <option value="1984">1984</option>
                <option value="1985">1985</option>
                <option value="1986">1986</option>
                <option value="1987">1987</option>
           &nbs



Posted By: michael
Date Posted: 24 March 2003 at 10:07am
And the error is??


Posted By: squalleonhart
Date Posted: 25 March 2003 at 2:31am

this is error when i want to search the data from my database

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '(Price + Replace(result1__MMColParam,'.
/cartrader/result.asp, line 34

  • Page:
    POST 70 bytes to /cartrader/result.asp

  • POST Data:
    Make=Volvo&Car_Year=2000&Price=BETWEEN+100000+AND+250000&Submit=Search


  • Posted By: squalleonhart
    Date Posted: 25 March 2003 at 2:41am

    i think the main problem for this question is SQL, it's become a problem when i want to search by price..

    can someone fix it to me



    Posted By: Scotty32
    Date Posted: 25 March 2003 at 6:48am

    i dont know much ASP but have you put the last couple of ")" in it?

    '(Price + Replace(result1__MMColParam))'

    does it look like that, cose its sayin sumfins missin so could be that

    but like i said, i dont know much asp



    Posted By: faubo
    Date Posted: 25 March 2003 at 8:00am

    yep, review your query, the error is saying is a sintax error, believe it.

    Meybe a " or a ) or something else is missising.



    -------------
    http://www.conhecerparaconservar.org - I don't know how to make you click here


    Posted By: zaboss
    Date Posted: 25 March 2003 at 8:15am

    "Missing operator" means exactly what it says! There is something missing. Perhaps data pulled from the db contains quotes and they are interpreted as operators in the sql query. Or you "spell" wrong the data types... I'm sorry I do not have the time to look to your code, it's realy too big to understand it and point you to the right syntax but:
    a) check the data type and make sure that you spell them right
    b) make sure you not pull out from the db quotes, paranthesis or blanks...
    c) good luck



    -------------
    Cristian Banu
    http://www.soft4web.ro - Soft 4 web


    Posted By: squalleonhart
    Date Posted: 26 March 2003 at 8:52am

    today..when i checked back my SQL, i found the error..i used the same parameter twice, so its become an error when i want to called the data from my database..

    anyway..thanzx 4ur help 




    Print Page | Close Window

    Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
    Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net