Solved

creating search criteria

Posted on 1998-07-26
1
167 Views
Last Modified: 2013-11-20
hello, i am currently trying to set up a search of a database on multiple fields. how would i go about
doing this without using any data from the database. example setting up a minimum and maximimum
price amount where i have a field called price, want to search with parameters, say they are looking
for a 55,000.00 house, i want to search for all houses between the range of 45,000.00 and
65,000.00. is there an easy way of doing all that i want.
0
Comment
Question by:borggies
1 Comment
 
LVL 7

Accepted Solution

by:
psdavis earned 50 total points
Comment Utility
I am assuming a DAO or a ODBC database...

In DAO (probably ODBC as well) you can either create a CDaoQueryDef or set the m_strFilter parameter of a CDaoRecordset.

Setting the m_strFilter parameter...

m_strFilter.Format( "WHERE [Price Range] IS BETWEEN %d and %d", iLowPrice, iHighPrice );

and then a CDaoRecordset::Requery( )

should do the trick for you.  You can do a CDaoQueryDef by adding it to your database (via Access) and allowing the low and high prices to be parameters (look it up in a TechNote, it's pretty well laid out)

Phillip

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now