Please help me in VB6 ADO ListView Database Connection

connection mean? you want to show the data in list view? if it is then plz write this:

Global rs As ADODB.Recordset
Global rs1 As ADODB.Recordset
Global Adb As ADODB.connection
Public Sub path()
cmd = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\db.mdb;Persist Security Info=False"
Set Adb = New ADODB.connection
With Adb
    .ConnectionString = cmd
    .Open
End With
End Sub
Private Sub Form_Load()
Dim i As Integer
Call path
SQL = "select * from material"
Set rs = New ADODB.Recordset


 i = 1
 rs.Open SQL, Adb, adOpenDynamic, adLockOptimistic
        Do While Not rs.EOF
           listview.ListItems.Add i, , i
            listview.ListItems(i).SubItems(1) = rs!id
            listview.ListItems(i).SubItems(2) = rs!Name
            listview.ListItems(i).SubItems(3) = rs!unit
            i = i + 1
            rs.MoveNext
        Loop
    rs.Close
End Sub

You can try the sample code in the link. The code needs to be modified to suit your exact requirements.

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.