1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Dim db As ADODB.Connection
Dim rst As ADODB.Recordset
Dim cmd As ADODB.Command
Set db = New ADODB.Connection
With db
.provider = "Microsoft.JET.OLEDB.4.0"
.ConnectionString = ActiveWorkbook.Path + "\" + nom_base
.ConnectionTimeout = 6
.CommandTimeout = 60
.Open
End With
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = db
pp = InputBox("Votre clé :", , 1)
.CommandText = "select nom,LSP from table1 where (table1.LSP BAND " & pp & ")=table1.LSP;" 'nom de la requete
Set rst = .Execute |
Partager