ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 21st, 2003, 09:41 AM
emilyatuni emilyatuni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 1 emilyatuni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Using information from a form to search a database

Hey,

I'm trying to use information that a user enters into an HTML form to search a database. For example, if a user clicks on a check box stating their interests are 'holidays' then this information needs to be used to search the database for entries that match, ie the entry has a category that states it is about holidays.

The entries in the database are linked to pictures that will then be loaded onto a website. I need to use ASP for this as well but have got completely stuck and don't know where to start, therefore any help is greatly appreciated.

Thanks

Reply With Quote
  #2  
Old February 24th, 2003, 09:05 AM
Utopia's Avatar
Utopia Utopia is offline
superficial
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Peterborough, England
Posts: 188 Utopia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m 8 sec
Reputation Power: 7
Quite a lot to ask really, don't you think?

To start with, you need a html form that looks like this
Code:
<form method="post">
<input type="checkbox" name="searchchoice" value="holidays" />
<input type="checkbox" name="searchchoice" value="cars" />
<input type="checkbox" name="searchchoice" value="monkeys" />
</form>


and an asp page that does something like.....

Code:
dim c, r, s

set c = createobject("adodb.connection")
set r = createobject("adodb.recordset")

c.connectionstring = (connectionstring needed here)
c.provider = "Microsoft.Jet.OleDB.4.0"
c.open

s = "select * from wherever where something like '" & request.form("searchchoice") & "'"

Set r = c.execute(s)

while r.eof = false
response.write r.fields(0) & "<br>"
response.write r.fields(1) & "<br>"
response.write r.fields(2) & "<br>"
r.movenext
wend


you'd need something in place that makes sure they only select one choice, otherwise it will screw the SQL statement up.......

If you selected "Holidays" then the SQL would be select * from wherever where something like 'holidays' and if the other choices are picked, holidays would be replaced with the respective choice. then a simple loop will write out all rows that match the SQL statement.

I'd recommend a book on ASP!

By the way, that won't work by itself but it demonstrates what you need to do, in a crude way.
__________________
_______________
Matt

Last edited by Utopia : February 24th, 2003 at 09:10 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Using information from a form to search a database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway