Help with Database Access Page

M

Mark

I've got a page
(http://www.remaxmetrori.com/remax_metro_ri__listing_query
..htm) that I would like to have query the database based
on one or more critera as selected by the user. There
are three drop lists and one text box. I'm a little
unsure about how to do this....

Right now, I've got '%' for a value for the generic Drop
Down List choices except for the one numeric based,
that's '1 OR 1'. I have de-selected 'Data required'
and 'Disallow first choice' in the Validation window for
each.

My SQL statement looks like this:

SELECT
Property.AgentName,Property.Price,Property.Propertytype,Pr
operty.City,Property.Style,Property.Housesize,Property.Bed
rooms,Property.Baths,Property.Halfbaths,Property.Totalroom
s,Property.Lotsize,Property.Description,'<img src=' &
Property.Propertyphoto &'>' as piclink
FROM Property
WHERE (AgentName LIKE '::AgentName::') OR (Propertytype
LIKE '::propertytype::') OR (City LIKE '::City::') OR
(Price LIKE ::price:: )

The problems that I'm having are that it won't let me
search on just a single choice, it prompts me to keep
selecting/entering data until each of the four is
populated and then, it returns every item in the database.

Any help or direction to a helpful resource would be
appreciated.

Thanks,

Mark
 
J

Jim Buyens

You need to AND your conditions together, as in

WHERE (AgentName LIKE '::AgentName::')
AND (Propertytype LIKE '::propertytype::')
AND (City LIKE '::City::')
AND (Price LIKE ::price:: )

If you OR them, as soon as you get one LIKE '%' you're
going to get the whole table.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
M

Mark

Thanks! Worked like a charm!

-----Original Message-----
You need to AND your conditions together, as in

WHERE (AgentName LIKE '::AgentName::')
AND (Propertytype LIKE '::propertytype::')
AND (City LIKE '::City::')
AND (Price LIKE ::price:: )

If you OR them, as soon as you get one LIKE '%' you're
going to get the whole table.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------






.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top