Home | Advertising Info59 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages what is asp programming how to sample asp example code scripts software asp forum mail sessions applications global.asa CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: Search Engine Problem
From: lukas
Date: 5/4/1999 1:02:22 PM
IP: 131.130.232.62



 

I created a little search engine that allows to enter in a query form +, - and or ....
My current problem is that with my script now it searchs only through one column of my database called "employees". The script for that is:

if Request.form("DaInBox") <> "" then
query = query & combine
Call parse ("Title", Request.Form("DaInBox"))
combine = " AND "
end if

The database contoins one table called employees with the columns Title, Description,Email

So how can i change the code that it allows me to search through all this fields.

Heres the whole code:

<%
sub parse(field, s) query = query & combine & "("

' if it begins and ends with a quote
' use Mid to cut out what is between the quotes

if Left(s,1) = """" and Right(s,1) = """" then
query = query & field & " LIKE '%" _
& Mid(s, 2, Len(s)-2) & "%'"

' or if it has a plus (+) in it

elseif InStr(s,"+") > 0 then
wordList = Split(s, "+")
for word = 0 to UBound(wordList)
query = query & field & " LIKE '%" & wordList(word) & "%'"
if word < UBound(wordList) then
query = query & " AND "
end if
next

' or if it starts with a minus (-)

elseif Left(s,1) = "-" then
query = query & field & " NOT LIKE '%" _
& Right(s, Len(s)-1) & "%'"

' otherwise split on spaces

else
wordList = Split(s)
for word = 0 to UBound(wordList)
query = query & field & " LIKE '%" & wordList(word) & "%'"
if word < UBound(wordList) then
query = query & " OR "
end if
next
end if

query = query & ")"
end sub

'Here starts the code as u can see it can only go through the Title column and not of the rest of it, but i dont know what i have to change.
'DaInBox=The SearchForm on a html Site

if Request.form("DaInBox") <> "" then
query = query & combine
Call parse ("Title", Request.Form("DaInBox"))
combine = " AND "
end if

' now build the full query and run it

query = "SELECT * FROM employees" _
& " WHERE " & query & " ORDER BY Title"

Set rs = db.Execute(query,&H0001) %>

thanks for helping

lukas


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com