1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| 'Avec Reférence DAO 3.6 Object Library
Dim Donnees As DAO.Database
Dim Requete As DAO.Recordset
Dim Chemin As String
Chemin = "C:\XXXXXXXXXX\XXXXX\XXXXX\"
Set Donnees = DAO.OpenDatabase(Chemin, False, False, "Text;Database=" & Chemin)
Set Requete = Donnees.OpenRecordset("SELECT champs2 FROM [MonFichierCsv.csv] WHERE champs1 = 'X'", DAO.dbOpenSnapshot)
Me.MaListe.Clear
Me.MaListe.Style = fmStyleDropDownList
Do While Not (Requete.EOF)
Me.MaListe.AddItem Requete.Fields(0).Value
Requete.MoveNext
Loop
Me.MaListe.ListRows = 255
Me.MaListe.ListIndex = 0 |
Partager