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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 26th, 2003, 12:47 PM
amateurASP amateurASP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 81 amateurASP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 16 m 28 sec
Reputation Power: 5
ASP Wilcard Search

I have an ASP search form on an Access db which allows me to search based on LastName, FirstName, or Club. When I added the wilcard "%" to the search query for LastName it disables the ability to search on the other two fields and returns ALL records.

s-sql="SELECT * FROM Alumni WHERE (Club = '::Club::' OR FirstName = '::FirstName::' OR LastName like '%::LastName::%') ORDER BY LastName ASC"

It doesn't matter where I put a wildcard, it disables all the other search criteria

Last edited by amateurASP : September 26th, 2003 at 01:14 PM.

Reply With Quote
  #2  
Old September 26th, 2003, 12:50 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,712 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 47 m 6 sec
Reputation Power: 688
I think you need to add the like condition to each of the search fields.

Reply With Quote
  #3  
Old September 26th, 2003, 12:53 PM
amateurASP amateurASP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 81 amateurASP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 16 m 28 sec
Reputation Power: 5
I tried that but then I none of the search fields worked

Reply With Quote
  #4  
Old September 26th, 2003, 12:57 PM
amateurASP amateurASP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 81 amateurASP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 16 m 28 sec
Reputation Power: 5
Actually the first two fields always return *.* the third field works fine

Reply With Quote
  #5  
Old September 26th, 2003, 01:39 PM
amateurASP amateurASP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 81 amateurASP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 16 m 28 sec
Reputation Power: 5
Ok, I solved it by having one input field instead of 3, named "SearchValue" and then checking each db field against that value.

s-sql="SELECT * FROM Alumni WHERE (Club like '::SearchValue::%' OR FirstName like '::SearchValue::%' OR LastName like '::SearchValue::%') ORDER BY LastName ASC"

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > ASP Wilcard Search


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


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





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