Dim Con As New ADODB.Connection
Dim RS As New ADODB.Recordset
Set Con = New ADODB.Connection
Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & ThisWorkbook.Path & "\Adres.mdb;"
Set RS = New ADODB.Recordset
RS.Open "SELECT * FROM [AccessTable]", Con, adOpenDynamic, adLockOptimistic
With RS
.MoveLast
Counter = .RecordCount
.MoveFirst
End With
ListBox1.ColumnCount = RS.Fields.Count
ListBox1.Column = RS.GetRows(Counter)
RS.Close
Con.Close
Set RS = Nothing
Set Con = Nothing