Data Model > Available DSCs > ADO DSC > Example .adoinfo files > Microsoft Excel worksheets
 
Microsoft Excel worksheets
This .adoinfo file uses the Microsoft OLE DB Provider for ODBC Drivers and the ODBC data source called Excel Files to read the Sheet1 worksheet in an Excel file called C:\samples\MyMuseumData.xls:
<ADODSC>
<ConnectionString>
DSN=Excel Files;
DBQ=C:\samples\MyMuseumData.xls;
DriverId=790;
MaxBufferSize=2048;
PageTimeout=5
</ConnectionString>
<Table>
Sheet1
</Table>
</ADODSC>
Depending on the version of Excel installed on your computer, you may have to add a dollar sign ($) after the worksheet ("table") name to be able read the worksheet successfully. Therefore, in the above example, the table name would be Sheet1$.
Here is another example that reads the Sheet1 worksheet in C:\samples\MyMuseumData.xls. However, this example uses the Microsoft Jet 4.0 OLE DB Provider. Generally, it is preferable to read Excel data using the Microsoft OLE DB Provider for ODBC Drivers because it will return variables in the order specified in the SQL query (or in the original order in the input data source if no query is specified), whereas the Jet provider always returns variables in alphabetical order.
<ADODSC>
<ConnectionString>
Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:\samples\myMuseumData.xls;
Extended Properties=Excel 8.0;
Persist Security Info=False
</ConnectionString>
<Table>
Sheet1
</Table>
</ADODSC>
See also
Example .adoinfo files