• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

Search string in listview vb6

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.
1 Solution

Just include wild card in your query...

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now