Asp newbee needs database searching help.

Results 1 to 2 of 2

Thread: Asp newbee needs database searching help.

  1. #1
    Tara Lang Guest

    Default Asp newbee needs database searching help.

    Hi:<BR>I&#039m very new to asp, so this may sound like a dumb question. I figured out how to display just the records that start with A in my database. But I want someone to be able to search the database of companies by typing in a company name and having it search and return similar records. This is my code for A:<BR><BR>&#060;%<BR>&#039 Substitute in form parameters into the query string<BR>fp_sQry = "SELECT [Retailer List].[Company Name], [Retailer List].District, [Retailer List].[Location Area Code], [Retailer List].[Location Phone], [Retailer List].[Membership Date] FROM [Retailer List] WHERE ((([Retailer List].[Company Name]) LIKE&#039A%&#039) AND (([Retailer List].[Membership Date]) Is Null)) ORDER BY [Retailer List].[Company Name]; "<BR><BR>Can anyone tell me how to change this to have the form value inserted with a wildcard after instead of A? I have the form set up: method=GET, action="filename.asp".<BR><BR>Please post here or email<BR><BR>Thanks so much!<BR>

  2. #2 Guest

    Default RE: Asp newbee needs database searching help.

    Get is querystring so<BR><BR>strVariable = Request.Querystring("name of control on sending form")<BR><BR>SQL = "Select * from RetailerList WHERE ((([Retailer List].[Company Name]) LIKE &#039" & strVariable & "%&#039)"<BR><BR><BR>If you change the Form Method to POST instead of GET change to <BR><BR>strVariable = Request.Form("name of control")<BR>

Posting Permissions

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