Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: search facility - setting up MS Access 2000


Message #1 by "Graham Abrey" <design@t...> on Thu, 14 Feb 2002 21:37:03
I have been trying to set up NS Access 2000 using a query. I want to send 

the query a series of word which it will then use with a wild card to 

search for relevant data. ie the word DESIGN is inserted in a form and 

the data shipped back should be "what ever DESIGN what ever".

My problem is setting up Access. I have tried put [SearchCriteria:] in 

the criteria area which work by asking for the relevant Info but I cant 

seem to get it to work with the wild card using the following formula 



Like "*[SearchCriteria:]*"



It does not ask me for any info and it shows all the records.



Does anyone know how to fix this formula.



Thanks

Graham
Message #2 by "Ken Schaefer" <ken@a...> on Fri, 15 Feb 2002 16:32:35 +1100
www.adopenstatic.com/faq/likequeries.asp



strSQL = ... & _

    "WHERE field1 LIKE '%" & strSearchCriteria & "%'"



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Graham Abrey" <design@t...>

Subject: [access_asp] search facility - setting up MS Access 2000





: I have been trying to set up NS Access 2000 using a query. I want to send

: the query a series of word which it will then use with a wild card to

: search for relevant data. ie the word DESIGN is inserted in a form and

: the data shipped back should be "what ever DESIGN what ever".

: My problem is setting up Access. I have tried put [SearchCriteria:] in

: the criteria area which work by asking for the relevant Info but I cant

: seem to get it to work with the wild card using the following formula

:

: Like "*[SearchCriteria:]*"

:

: It does not ask me for any info and it shows all the records.

:

: Does anyone know how to fix this formula.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Message #3 by "Graham Abrey" <design@t...> on Fri, 15 Feb 2002 11:02:39
Hi, 

Thanks for that but its not quite what I am after. The problem is not to 

do with the coding in ASP but with setting up the MS Access query. You 

should be able to test the query manually by putting data into it.  What 

would the criteria be to make Access use a variable to be placed into the 

DB . It usually accepts [CriteriaData:] which access then asks for the 

info. I want it to do exactly the same but with a wild card each side i.e 

*[CriteriaData:]* but it simply doen't work.



Help

Thanks Graham









> www.adopenstatic.com/faq/likequeries.asp

> 

> strSQL = ... & _

>     "WHERE field1 LIKE '%" & strSearchCriteria & "%'"

> 

> Cheers

> Ken

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> From: "Graham Abrey" <design@t...>

> Subject: [access_asp] search facility - setting up MS Access 2000

> 

> 

> : I have been trying to set up NS Access 2000 using a query. I want to 

send

> : the query a series of word which it will then use with a wild card to

> : search for relevant data. ie the word DESIGN is inserted in a form and

> : the data shipped back should be "what ever DESIGN what ever".

> : My problem is setting up Access. I have tried put [SearchCriteria:] in

> : the criteria area which work by asking for the relevant Info but I 

cant

> : seem to get it to work with the wild card using the following formula

> :

> : Like "*[SearchCriteria:]*"

> :

> : It does not ask me for any info and it shows all the records.

> :

> : Does anyone know how to fix this formula.

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> 

Message #4 by "Owain Williams" <email@o...> on Mon, 18 Feb 2002 11:31:38
Try this in the Criteria section of the MS Access Query:



Like "*" & [SearchCriteria:] & "*"



Hope this helps.
Message #5 by "Graham Abrey" <design@t...> on Wed, 20 Feb 2002 18:44:28
Brilliant,

Thanks for your help

Graham



> Try this in the Criteria section of the MS Access Query:

> 

> Like "*" & [SearchCriteria:] & "*"

> 

> Hope this helps.

  Return to Index