Solved

creating search criteria

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 133
while loop over for loop 7 115
difference between String.subString() and String.subSequence() 6 234
Not needed 13 119
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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