please can somebody help me to load a records from a textfile(random acces file)and display it into te lisview.

Recommended Answers

All 2 Replies

Please be more specific. Specify the format of the records in the text file. Or else, state what exact problem you're facing in doing the above task.

'This example is for Text File
'Add Component Microsoft Windows Common Controls 6.0 (SP6)
Private Sub Command1_Click()
Dim xData As String
With ListView1
.FullRowSelect = True
.GridLines = True
.View = lvwReport
.ColumnHeaders.Add , , "DATA"
.ColumnHeaders(1).Width = 4124.977
End With
'Open a text file
Open "c:\SampleTextFile.txt" For Input As #1
'Loop until End of the Record of the text file
Do Until EOF(1)
'Read the data
Line Input #1, xData
'Passing the data to Listview Control
ListView1.ListItems.Add , , xData
Loop
Close #1

End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.