> Trying to retrieve a recordset using a saved parameter query in
> Access. the query is named "resultsq1x"
> works fine when i run it within access:
> SELECT Results.ref, Results.commodity, IMPACTWEB.Field5,
> FROM IMPACTWEB RIGHT JOIN Results ON Results.ref=IMPACTWEB.Field5
> WHERE (Results.ref=[searchterm] Or IMPACTWEB.Field20 LIKE "*" &
> [searchterm] & "*");
> I call this query from an ASP page like so:
> searchterm = Request.Form("blah")
> Set objConnection = Server.CreateObject("ADODB.Connection")
> objConnection.Open import_entry
> Set RS = Server.CreateObject("ADODB.Recordset")
> objConnection.resultsq1x searchterm, RS
> Do While Not RS.EOF
> When I run it from a browser (after inputting the searchterm), It will
> return correctly if I put in a "ref" number that exists.
> However, it will not return any records if I put in a string that
> exists in the "Field20" field of a record.
> If I modify the query and change: LIKE"*" & [searchterm] & "*"
> to just: LIKE [searchterm]
> then the query works correctly, returning record(s) if there is a
> string that equals the "ref" field, or if the string matches a
> complete string in the "Field20".
> Why can't i use the LIKE "*" & [searchterm] & "*" when it works
> perfectly run from within Acess?? I want to search on fields that
> just might CONTAIN the string.