Adding search function in asp page

Posted on 2010-01-04
Last Modified: 2012-05-08
New to ASP, i have an asp page outputs data from an access DB. I want to add search function in this page. The data is Name, Title, etc.. I want to add the Name search.

If it is easy, i would like to add the quick find search also (output the search results as you type in the search box, as in google search)

Thanks for your help
Question by:Basheerpt
    LVL 5

    Accepted Solution


    you can simply use the access query to add the search option in your page.

    SearchText = request.form("<<Search Inputbox>>")

    Set Conn = Server.CreateObject("ADODB.Connection")

    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("<<dbname.mdb>>") & ";Persist Security Info=False"

    strsql = "SELECT name, title FROM <<table name> WHERE (name LIKE '%"& SearchText &"%' or title like '%"& SearchText &"%')"

    set objrec = server.CreateObject("ADODB.recordset")

    objrec.Open strsql,conn

    while not objrec.eof
    response.write "Name :" &  objrec("name") & "<br>Title :" & objrec("title") & "<br><br>"

    Try It!
    LVL 5

    Author Comment

    I had not seen your reply! i will try it and get you back. Thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now