Solved

creating search criteria

Posted on 1998-07-26
1
168 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ORA-01403: no data found 43 89
sumDigits challenge 9 120
sum28 challenge 31 105
Detect file exist or not 3 128
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 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

19 Experts available now in Live!

Get 1:1 Help Now