V
Vuillermet Jacques
This code works fine with an Oracle database via ODBC.
But with SQL Server via OLEDB an 1004 error occurs : why ???
["xxx" replaces private data]
Dim qt As Excel.QueryTable
Dim strSQL As String
Dim strConnexion As String
strSQL = "SELECT Id, Libelle FROM Profil"
strConnexion = "Provider=sqloledb;Data Source=xxx.xxx.xxx.xxx;Initial
Catalog=xxx;User Id=xxx;Password=xxx"
Set qt = ActiveSheet.QueryTables.Add(Connection:=strConnexion,
Destination:=ActiveSheet.Range("A1"), Sql:=strSQL)
The strConnexion has been generated by an UDL file.
Thanks.
Jacques.
But with SQL Server via OLEDB an 1004 error occurs : why ???
["xxx" replaces private data]
Dim qt As Excel.QueryTable
Dim strSQL As String
Dim strConnexion As String
strSQL = "SELECT Id, Libelle FROM Profil"
strConnexion = "Provider=sqloledb;Data Source=xxx.xxx.xxx.xxx;Initial
Catalog=xxx;User Id=xxx;Password=xxx"
Set qt = ActiveSheet.QueryTables.Add(Connection:=strConnexion,
Destination:=ActiveSheet.Range("A1"), Sql:=strSQL)
The strConnexion has been generated by an UDL file.
Thanks.
Jacques.