1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DRIVER=SQL Server;SERVER=XX.XXX.XX.XXX
;UID=XXXX;PWD=XXXX;APP=Microsoft Office XP;WSID=GHDt;DATABASE=TRACA_TDE;Network=DBMS" _
), Array("SOCN")), Destination:=Range("N28"))
.CommandText = Array( _
"SELECT AUTOGEN.Atelier_Poste, AUTOGEN.MAJ" & Chr(13) & "" & Chr(10) & "FROM TRACA_TDE.tde.AUTOGEN AUTOGEN" _
)
.Name = "Lancer la requête à partir de tde_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With |
Partager