Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search and show listview

Status
Not open for further replies.

Poloboy

Technical User
Aug 26, 2002
58
US
Hi Everyone,
I'm new to VB6 so please bare with me. I wrote a small program to keep users info in Access database using DAO. Now, I need to retrieved the information and show it up in listview(lvwreport). Can anyone show me how to do a search for lastname or firstname and show all records that matches the search to listview(lvwreport)?

Thank you
 
You need to write the select statement which is a string.
Dim qsSel as string
qsSel="SELECT * FROM tablename WHERE lastname LIKE '*" & txtlastname.text & "*'"

The above will return all (*) record columns where the lastname database field looks like the textbox's text...

Execute the select statement and bind the data to the control.

BTW, since your are new to vb programming, why vb6 and not .NET?
 
Hi TipGiver,
Thanks for responding to my thread. I'm new to VB6 I don't know how to write search function. Can you please show me the code so I can return search records to listview(lvwreport) I know, I start out on the wrong foot. After this I will go with .NET....Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top