This is the basic way on how to display data on a List View Control in Visual Basic 6.0, First
you must Add the control Project > Components > Microsoft Windows Common Controls
6.0 (SP6), then drag the List view Control: at the general tab, at View: select the Report View:
'Declare a variable that holds for ListItem
Dim Panoy As ListItem
'set the listitem shown in the code below
Set Panoy = ListView1.ListItems.Add(, , "Adrian")
Record-set, this is done through the Do While Loop structure:
Dim Mrhumble As String ' this the string holds the query
Dim Panoy As ListItem 'holds your Listitem
this is the Update of this post, due to the request of some readers to create a
downloadable project or file, first of all i want it to show the project screen shots
Down Load File
Hope this will Help
Happy Coding (^_^)
you must Add the control Project > Components > Microsoft Windows Common Controls
6.0 (SP6), then drag the List view Control: at the general tab, at View: select the Report View:
Here the sample Code:
'Declare a variable that holds for ListItem
Dim Panoy As ListItem
'set the listitem shown in the code below
Set Panoy = ListView1.ListItems.Add(, , "Adrian")
Displaying Data from your Database:
make sure that your database connection are properly set initialize the Connection and theRecord-set, this is done through the Do While Loop structure:
Dim Mrhumble As String ' this the string holds the query
Dim Panoy As ListItem 'holds your Listitem
With ListView1
Set RS=New Adodb.Recordset
Set Conn=New Adodb,Connetion
Mrhumble="SELECT * FROM MyName"
Rs.Open Mrhumble,Conn
Do While Not RS.EOF Set Panoy=.ListItems.Add(, , Rs!FName)
Panoy.Subitems(1)=Rs!MI
Panoy.Subitems(2)=Rs!LName
Rs.MoveNext
Loop
End Withthis is the Update of this post, due to the request of some readers to create a
downloadable project or file, first of all i want it to show the project screen shots
Figure 1.0
the figure shown to you, on adding data from the
3 text boxes
Figure 1.1
this image shown to on getting the data from database
Hope this will Help
Happy Coding (^_^)
sir, kindly give a downloadable sample on this code.. thanx! keep on sharing
a ok!! ^_^
Thank You for sharing.
- Stephen