1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| With ActiveWorkbook.Connections(Fichier). _
OLEDBConnection
.BackgroundQuery = True
.CommandText = Array(macommande)
.CommandType = xlCmdSql
.Connection = Array( _
"OLEDB;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=masource;Use Procedure for Pre" _
, _
"pare=1;Auto Translate=True;Packet Size=4096;Workstation ID=monordi;Use Encryption for Data=False;Tag with column collation whe" _
, "n possible=False;Initial Catalog=moncatalog")
.RefreshOnFileOpen = False
.SavePassword = False
.SourceConnectionFile = ""
.SourceDataFile = ""
.ServerCredentialsMethod = xlCredentialsMethodIntegrated
.AlwaysUseConnectionFile = False
.ServerFillColor = False
.ServerFontStyle = False
.ServerNumberFormat = False
.ServerTextColor = False
End With
'..
'..
'..
'...etc.
End Sub |
Partager