Search string in listview vb6

Posted on 2009-04-28
Last Modified: 2012-05-06
Dear experts,
I have a listview in my vb6 application which shows a list of country names. I have a textfield where user can search for a particular country. I designed my textbox so that for each letter the user type, the listview will filter and display countries with that letters. However, now i need to do a search for countries with more than 1 string such as saudi arabia, united states of america, united kingdom and so on... (eg. for saudi arabia, i need when the user entered 'arab', that country saudi arabia is also displayed or if the user entered 'sau', saudi arabia is also displayed). How am i going to do this? Any ideas to help me going experts?? Thank you.

btw, currently, i did the search by filtering it through my database and redisplay the results on my listview with "select * from country where country_name like 'text5'" and display the result with each keystrokes entered by user.
Question by:Slythie
    LVL 15

    Accepted Solution


    Just include wild card in your query...

    "select * from country where country_name like '%" & txtSearch.text & "%'"

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 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

    14 Experts available now in Live!

    Get 1:1 Help Now