|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
Keyword Search Problem
Hi guys,
I'm having a small problem with a keyword search not functioning correctly. Here's the scenario .... I'm using ASP in DWMX, with Access 2000 and am simply using a multiple search page where the user can select various options or just one option. One of these boxes is a keyword box named 'Des' (for description) This is named the same in the database. On the results page I have a recordset and have set up my variables. One variable is called sSchool which refers to simply a drop down on the search page and the other is the sDes variable which refers to a text box for entering keywords. The variable code for the keyword field is ... name = sDes default value = %how% runtime value = request.form("Des") My SQL in the advanced box is.... SELECT * FROM Links WHERE Des LIKE 'sDes' AND School LIKE 'sSchool' I have tried modifying this, mainly in the default value column i.e. just having % but still no luck. The School bit works fine, just not he keyword bit. Any ideas where I'm going wrong?? Any help would be much appreciated as I've spent hours!!! Appologies if this is slightly in the wrong forum area, but wasn't quite sure where best to put it. Thanks in advance Jon |
|
#2
|
|||
|
|||
|
try the following
Code:
Dim querystring querystring = "SELECT *FROM Links WHERE Des LIKE '%" & sDes & "%' AND School LIKE '%" & sSchool & "%'"
__________________
How can I soar like an eagle when I'm flying with turkey's? |
|
#3
|
|||
|
|||
|
Thanks for the reply....
I've managed to sort it now.
I tried using your line of code but is didn't seem to like the use of the '%" bits for some reason. Which is odd as I'm sure I have used that expression before in a previous project. Anyways if you interested, here's my final SQL code... SELECT Created, Des, Title, School, Language FROM Links WHERE School LIKE 'varSchool' AND Language LIKE 'varLanguage' AND (Des LIKE '%varSearch%' OR Title LIKE '%varSearch%') Thanks again Jon |
|
#4
|
|||
|
|||
|
glad you got it sorted
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Keyword Search Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|