Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query doesn't work on Web (2000)

    I am trying to create a simple search function on a Web site that uses an Access 2000 database. I would like to search a text description field for any instance of the characters entered into the search control. In Access I do this using the Like keyword, e.g.:

    "WHERE (tbl_Departments.DepartmentDesc Like '*" & strSearchString & "*') "'

    This works in Access but it doesn't work when I create the query string in an ASP page and open a recordset via ADO. When I replace the Like with a '=' (equals):

    "WHERE (tbl_Departments.DepartmentDesc = '" & strSearchString & "') "'

    it works, so I know that everything else on the ASP page is working. The only difference is the use of the Like keyword.
    Does anybody know if Like is supported by the Jet provider? Is there another way of getting the same result?

    Ian

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query doesn't work on Web (2000)

    Try replacing the * as wildcard with %.

  3. #3
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query doesn't work on Web (2000)

    That worked. Thanks again. Best Access site on the Web!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •