Solved

creating search criteria

Posted on 1998-07-26
1
170 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
ID: 1319762
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 127
post4 challenge 28 99
Use of condition with 'serial' in ansible 2 58
wordmultiple challenge 12 131
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

815 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

9 Experts available now in Live!

Get 1:1 Help Now