delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

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


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

TOP

try the following
Code:
  1. Dim querystring
  2. querystring = "SELECT *FROM Links WHERE Des LIKE '%" & sDes & "%' AND School LIKE '%" & sSchool & "%'"
Copy Code

TOP

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

TOP

glad you got it sorted



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

TOP

Back Forum