I suspect that there simply isn't a way to do what you describe using OLEDB.
I tested the following VBA code and it worked:
Sub odbcTest()
Dim cdb As DAO.Database, sql As String
Set cdb = CurrentDb
sql = _
"SELECT ID, LastName INTO myContacts " & _
"FROM [ODBC;Driver={SQL Server Native Client 10.0};Server=.\SQLEXPRESS;Database=myDb;Trusted_Connection=yes;].dbo.myContacts"
cdb.Execute sql, dbFailOnError
End Sub
Then, I tested (what I hoped would be) the OLEDB equivalent and it failed with the same error that you got ("Could not find installable ISAM.")
Sub oledbTest()
Dim cdb As DAO.Database, sql As String
Set cdb = CurrentDb
sql = _
"SELECT ID, LastName INTO myContacts " & _
"FROM [OLEDB;Provider=SQLNCLI10;Server=.\SQLEXPRESS;Database=myDb;Trusted_Connection=yes;].dbo.myContacts"
cdb.Execute sql, dbFailOnError
End Sub
But notice the ODBC;
and OLEDB;
prefixes inside the square brackets: They are not needed when establishing a "normal" connection. The following code works...
Sub adoTest()
Dim con As Object
Const sqlInstance = ".\SQLEXPRESS"
Set con = CreateObject("ADODB.Connection")
con.Open "Driver={SQL Server Native Client 10.0};Server=" & sqlInstance & ";Database=myDb;Trusted_Connection=yes;"
MsgBox "ODBC connection to " & sqlInstance & " established."
con.Close
Set con = Nothing
End Sub
...but when I add an ODBC;
clause to the beginning of the connection string...
Sub adoTest()
Dim con As Object
Const sqlInstance = ".\SQLEXPRESS"
Set con = CreateObject("ADODB.Connection")
con.Open "ODBC;Driver={SQL Server Native Client 10.0};Server=" & sqlInstance & ";Database=myDb;Trusted_Connection=yes;"
MsgBox "ODBC connection to " & sqlInstance & " established."
con.Close
Set con = Nothing
End Sub
...it fails with "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
So, that ODBC;
prefix in the first Sub odbcTest()
code sample above is a clue that the FROM [ODBC;...]
method is just an Access shortcut to pull data in from an ODBC data source without explicitly creating a linked table. (That stuff inside the square brackets would be the .Connect
property of the TableDef
object for a linked table.)
Therefore, since as far as I know Access only supports ODBC linked tables (and not OLEDB linked tables), using this method with OLDEB won't work.