Searching a database with ASP

Results 1 to 3 of 3

Thread: Searching a database with ASP

  1. #1
    Join Date
    Dec 1969

    Default Searching a database with ASP

    I applied the asp script from the "Searching" article to my web page and I am having trouble with the "strWhereClause" variable. You can find this article from this web site&#039s Search page. I&#039m not sure how to include this variable in my SQL statement.<BR><BR>This is how I&#039ve inserted the "strWhereClause" variable in my SQL statement:<BR><BR>strSearchSQL = "SELECT * FROM Policytbl WHERE &#039" & strWhereClause & "&#039 ORDER BY PolicyDescription"<BR><BR>When I send my search request to this asp page, I get all the records from my database instead of the records that meet my search request criteria. This indicates to me that my SQL statement is not working. Any suggestions?

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: Searching a database with ASP

    response.write strSearchSQL and see what the query getting executed is

  3. #3
    Culture Guest

    Default RE: Searching a database with ASP

    Don&#039t know if this will help, but its information anyway.<BR>On a search function you need to format it as follows:<BR><BR>Select fields from table where something = onefieldontable orderby something;<BR> <BR>if you follow that rule you should be fine.

Posting Permissions

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