|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
In the same database as my previous thread I am not sure if it is possible to do this. Using the 'Message' field in my Access 2002 database contains messages from users from an online chat conversation. I would like the user to enter a word eg 'ontology' When this query has been created it does not work as there are other words in the same field. If I create the query saying : SELECT Message FROM Message_Table WHERE Message LIKE *ontology* THIS WORKS .. but the query should be data independent, I need the user to specify the word and then add wildcards around it to select the correct message, otherwise the query returns nothing. Any ideas? |
|
#2
|
||||
|
||||
|
Example:
Code:
searchWord = Request.Form("SearchWord")
strSql = "SELECT * FROM Table WHERE FieldName LIKE '*" & searchWord & "*'"
|
|
#3
|
||||
|
||||
|
FYI: since you said in the previous thread you posted (which I answered, by the way) that you have an ms access database you can trigger a parameter in a query by entering [sometext] in the criteria. For your query you would enter
Like "*" & [enter search word] & "*" when you run the query ms access pops up a window for you to enter your value in. |
|
#4
|
|||
|
|||
|
I'll have a go and see how it all goes.
Thanks for the help -x- |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > wildcard around a 'word entered by a user' |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|