Bonjour,
sans connexion cela ne va pas servir a grand chose
Voila le code utilisé pour effectuer la requête
Sub RqAS400()
Dim Connect As String
Dim User As String
Dim Pass As String
Dim Dest As Range
User = "uid=********;"
Pass = "pwd=********"
Connect = "Connection:=ODBC;DSN=********;" & User & Pass
With ActiveSheet.QueryTables.Add(Connection:="ODBC;DSN=********;uid=********;pwd=*******", Destination:=Range("A1"))
Cells.ClearContents
.CommandText = Array("SELECT FBDCOE, FBDDS1, FBDP01,FBDNPE, FBDDCR FROM TOTO.KNFAEX.FAPCBDCE WHERE (FBDCOE like '15%') ORDER BY FBDCOE DESC")
.Name = "********"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub