ADO to connect Excel to Excel - OLEDB Providers?

lovallee

Board Regular
Joined
Jul 8, 2002
Messages
220
Hello,

For a while, I have been using ADO to use Excel as a database (i.e. link several Excel tables using SQL and return the results in an Excel pivot table).

With Excel 2003, I have been using one of the following connection string:

Code:
MyConnectionString2003 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                               "Data Source=" & MainSourceFile & ";" & _
                               "Extended Properties=""Excel 8.0;HDR=Yes"";"

OR

Code:
MyConnectionString2003 = "Driver={Microsoft Excel Driver (*.xls)};Dbq= " & MainSourceFile & ";ReadOnly=0;"

I understand both connection strings uses the JET OLEDB provider. They both works fine.



With Excel 2007, I have tried:

Code:
MyConnectionString2007 = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
                               "Data Source=" & MainSourceFile & ";" & _
                               "Extended Properties=""Excel 12.0;HDR=Yes"";"

OR

Code:
MyConnectionString2007 = "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};Dbq= " & MainSourceFile & ";ReadOnly=0;"

I understand both connection strings uses ACE OLEDB provider. Both works with simple SQL queries but fails with more complex queries (10+ tables). However the same complex queries were processed ok with the JET OLEDB provider.


Question:
Is there another OLEDB provider than ACE in Excel 2007 and if yes, what is/are the connection string(s)?

Thanks.

Louis
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,224,590
Messages
6,179,753
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top