Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: About Patterns

  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    147
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question About Patterns

    Hi,

    I written a code in ASP, however I am not able to find differents patters.

    My code:
    _______


    index.html


    <form method="get" name="theField" action="teste3.asp" onsubmit="makeWord(theField)">
    <input type="text" name="look_for" value="" ><BR>
    <input type=submit value="search">
    </form>

    booklet.asp

    Dim strKeyword
    strKeyword = Request.QueryString("look_for")

    rs.Open "Select * from madonna where english like '%" & strKeyword& "%' ", conn
    '' for exact matchthis works fine, however for match that starts with some characters or ends with some characters- the script not works!!!

    For example:

    rs.Open "Select * from madonna where english like '%" & strKeyword "%' ", conn

    or

    rs.Open "Select * from madonna where english like '%" strKeyword& "%' ", conn

    WHY I DONīT FIND MATCHS THAT START BY &strkeyword or ends by match
    strkeyword& ??

    Thank you very much in advance


    LeBRON

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    try:
    Code:
    rs.Open "Select * from madonna where english like  '" & strKeyword & "%' ", conn 
    
    or
    
    rs.Open "Select * from madonna where english like  '%" & strKeyword & "' ", conn
    the & is the concatenation oparator. The % is the wildcard. So don't drop the concatenation operator, but the wildcard
    I am the luckiest man in the world

  • #3
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    147
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you. Great help!

    LeBRON


  •  

    Posting Permissions

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