473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Asp Sql Search

347 100+
I have a database setup so that we can search audio files using our inranet the problem is if i want to search for more than 1 word e.g. if i search for yourkshir it returns all the items with yourshir listed in the type for the sound file but if i want to search for yorskshire and loud i do not know how to do this i have types set for sound files that include the words yorkshir and loud but cannot find any of the clips if i type both words in the serch box

here is the sql statement

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%searchid=Request.Querystring("id")%>
<%
Response.Expires=0
Set yaketyConnection=Server.CreateObject("ADODB.Connec tion")
DatabaseDetails="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("yakety2.mdb") & ";"
yaketyConnection.Open DatabaseDetails
yaketyQuery="SELECT * FROM mp3 WHERE celebname like '%"&searchid&"%' or mp3type like '%"&searchid&"%' or mp3typeb like '%"&searchid&"%' or mp3typec like '%"&searchid&"%'"
Set yaketyRecordset=yaketyConnection.execute(yaketyQue ry)

dlQuery="SELECT * FROM mp3 WHERE celebname like '%"&searchid&"%' or mp3type like '%"&searchid&"%' or mp3typeb like '%"&searchid&"%' or mp3typec like '%"&searchid&"%'"
Set dlRecordset=yaketyConnection.execute(dlQuery)

%>

I hope someone can assist
Mar 13 '08 #1
3 1545
jeffstl
432 Expert 256MB
I have a database setup so that we can search audio files using our inranet the problem is if i want to search for more than 1 word e.g. if i search for yourkshir it returns all the items with yourshir listed in the type for the sound file but if i want to search for yorskshire and loud i do not know how to do this i have types set for sound files that include the words yorkshir and loud but cannot find any of the clips if i type both words in the serch box

here is the sql statement

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%searchid=Request.Querystring("id")%>
<%
Response.Expires=0
Set yaketyConnection=Server.CreateObject("ADODB.Connec tion")
DatabaseDetails="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("yakety2.mdb") & ";"
yaketyConnection.Open DatabaseDetails
yaketyQuery="SELECT * FROM mp3 WHERE celebname like '%"&searchid&"%' or mp3type like '%"&searchid&"%' or mp3typeb like '%"&searchid&"%' or mp3typec like '%"&searchid&"%'"
Set yaketyRecordset=yaketyConnection.execute(yaketyQue ry)

dlQuery="SELECT * FROM mp3 WHERE celebname like '%"&searchid&"%' or mp3type like '%"&searchid&"%' or mp3typeb like '%"&searchid&"%' or mp3typec like '%"&searchid&"%'"
Set dlRecordset=yaketyConnection.execute(dlQuery)

%>

I hope someone can assist
Not with only 1 search parameter like that.

You will need atleast 2 search boxes, OR you will need to set your search up to handle a deliminated search in 1 search box (Like with a comma delimation such as yorkshir, loud)

Either way you go once you have both parameters then just do this with your query.

Expand|Select|Wrap|Line Numbers
  1. yaketyQuery="SELECT * FROM mp3 WHERE celebname like '%"&searchid1 & "%' or celebname like '%" & searchid2 &"%' or mp3type like '%"& searchid1 &"%' or mp3type like '%" & searchid2 & "%' or mp3typeb like '%"& searchid1 &"%' or mp3typeb like '%" & searchid2 & "%' "
  2.  
  3. 'and so on after that for your type c, etc....
  4.  
Mar 13 '08 #2
colinod
347 100+
Thanks for that does that mean that if we enter three words in the search box like yorkshir, loud, male that i would need 3 search ids one for each delimited word, if this is the case would you know how to find and posting of any of the words entered in the search box in a string of words i.e. if we typed yorkshire, loud, man could it find yorkshire man and loud even if they were not together in the searched field i was thinking of setting up a search field in my database and just adding all the words we would like the sound clip to be found under.....
Mar 14 '08 #3
jeffstl
432 Expert 256MB
Thanks for that does that mean that if we enter three words in the search box like yorkshir, loud, male that i would need 3 search ids one for each delimited word, if this is the case would you know how to find and posting of any of the words entered in the search box in a string of words i.e. if we typed yorkshire, loud, man could it find yorkshire man and loud even if they were not together in the searched field i was thinking of setting up a search field in my database and just adding all the words we would like the sound clip to be found under.....
I am not clear on what your question is.

If you need to know how to seperate the string out if you are using comma delimination (though depending on who your "users" are multiple search boxes will be much better) ...but with comma delimination with 1 search box you have to use the split function and string manipulation functions to get each seperate word into a variable.

http://www.w3schools.com/vbscript/func_split.asp

http://www.thescripts.com/forum/thread781497.html
Mar 14 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: R. Rajesh Jeba Anbiah | last post by:
Q: Is PHP search engine friendly? Q: Will search engine spiders crawl my PHP pages? A: Spiders should crawl anything provided they're accessible. Since, nowadays most of the websites are been...
1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
5
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine...
3
by: Alastair | last post by:
Hello guys, I've been building a search facility for an intranet site I'm part of developing and we've been building a search engine using Index Server. It mostly works, however there have been...
39
by: Noticedtrends | last post by:
Can inference search-engines narrow-down the number of often irrelevant results, by using specific keywords; for the purpose of discerning emerging social & business trends? For example, if...
22
by: Phlip | last post by:
C++ers: Here's an open ended STL question. What's the smarmiest most templated way to use <string>, <algorithms> etc. to turn this: " able search baker search charlie " into this: " able...
28
by: joshc | last post by:
If I have an array of data that I know to be sorted in increasing order, and the array is less than 50 elements, and I want to find the first element greater than a certain value, is a simple...
4
by: BenCoo | last post by:
Hello, In a Binary Search Tree I get the error : Object must be of type String if I run the form only with the "Dim bstLidnummer As New BinarySearchTree" it works fine. Thanks for any...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
0
by: passion | last post by:
"Specialized Search Engines" along with Google Search Capability (2 in 1): http://specialized-search-engines.blogspot.com/ Billions of websites are available on the web and plenty of extremely...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.