3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by debasisdas
0

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
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.