Ways of Opening Microsoft Excel Workbooks (.xls)

1. Opening through ODBC DSN. Select ADO or BDE interface, then choose ODBC data source option and then select the needed ODBC DSN from the drop-down list. But first, you should create an ODBC DSN of the corresponding type using Windows administrative tools, and point it to the database.

2. Opening by specifying file name. Select ADO interface, then choose File option and then browse for the needed file.

3. Opening through connection string. Select ADO interface, then choose Connection string option and write a connection string. This way is very flexible and allows to specify many additional parameters in the connection string. It is recommended for advanced users. Here are basic connection strings (more examples and details can be found in the Internet):

Provider=Microsoft.Jet.OLEDB.4.0;excel 8.0;DATABASE=C:\MyData\MyExcelData.xls;

Provider=MSDASQL.1;Extended Properties="DBQ=C:\MyData\MyExcelFile.xls;DefaultDir=C:\MyData;Driver={Microsoft Excel Driver (*.xls)};DriverId=790;"

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\MyData\MyExcelFile.xls;Extended Properties="Excel 8.0;HDR=YES";   (Microsoft ACE must be installed)

Sometimes, after opening Excel workbooks, you may see no tables in the file. If you are sure the file has data, try to open it by it's native program, assign name(s) to needed cell range(s), save, and then try to open it in Database Tour again. If the result is unsuccessful, try to open the file by direct specifying connection string with different parameters: for example, change ODBC-based string to Jet-based one (the differences are shown in examples of connection strings).

See also

 Examples of ADO Connection Strings