There are two interfaces available: Microsoft. Jet. OLEDB.4.0 (hereinafter referred to as the Jet engine) and Microsoft. ACE. OLEDB.12.0 (hereinafter referred to as the ACE engine ).
You are familiar with the Jet engine and can access Office 97-2003, but cannot access Office 2007.
The ACE engine is a database connection component released along with Office 2007. It can access Office 2007 or Office 97-2003.
In addition, Microsoft. ACE. OLEDB.12.0 can access an Excel file that is being opened, but Microsoft. Jet. OLEDB.4.0 cannot.
Syntax example:
--> Access Excel 97-2003 with the Jet engine
- Select * from OpenRowSet ('Microsoft. jet. OLEDB.4.0 ', 'excel 8.0; HDR = Yes; IMEX = 1; Database = D: \ 97-2003.xls', 'select * from [Sheet1 $] ')
- Select * from OpenRowSet ('Microsoft. Jet. OLEDB.4.0 ', 'excel 8.0; HDR = Yes; IMEX = 1; Database = D: \ 97-2003.xls', [Sheet1 $])
- Select * from OpenDataSource ('Microsoft. Jet. OLEDB.4.0 ', 'excel 8.0; HDR = Yes; IMEX = 1; Database = D: \ 97-2003.xls')... [Sheet1 $]
- Select * from OpenDataSource ('Microsoft. jet. OLEDB.4.0 ', 'Data Source = D: \ 97-2003.xls; Extended Properties = "Excel 8.0; HDR = Yes; IMEX = 1 "')... [Sheet1 $]
--> ACE engine access Excel 97-2003
- Select * from OpenRowSet ('Microsoft. ACE. OLEDB.12.0 ', 'excel 12.0; HDR = Yes; IMEX = 1; Database = D: \ 97-2003.xls', 'select * from [Sheet1 $] ')
- Select * from OpenRowSet ('Microsoft. ACE. OLEDB.12.0 ', 'excel 12.0; HDR = Yes; IMEX = 1; Database = D: \ 97-2003.xls', [Sheet1 $])
- Select * from OpenDataSource ('Microsoft. ACE. OLEDB.12.0 ', 'excel 12.0; HDR = Yes; IMEX = 1; Database = D: \ 97-2003.xls')... [Sheet1 $]
- Select * from OpenDataSource ('Microsoft. ACE. OLEDB.12.0 ', 'Data Source = D: \ 97-2003.xls; Extended Properties = "Excel 12.0; HDR = Yes; IMEX = 1 "')... [Sheet1 $]
--> ACE engine access Excel 2007
- Select * from OpenRowSet ('Microsoft. ACE. OLEDB.12.0 ', 'excel 12.0; HDR = Yes; IMEX = 1; Database = D: \ 2007.xlsx', 'select * from [Sheet1 $] ')
- Select * from OpenRowSet ('Microsoft. ACE. OLEDB.12.0 ', 'excel 12.0; HDR = Yes; IMEX = 1; Database = D: \ 2007.xlsx', [Sheet1 $])
- Select * from OpenDataSource ('Microsoft. ACE. OLEDB.12.0 ', 'excel 12.0; HDR = Yes; IMEX = 1; Database = D: \ 2007.xlsx')... [Sheet1 $]
- Select * from OpenDataSource ('Microsoft. ACE. OLEDB.12.0 ', 'Data Source = D: \ 2007.xlsx; Extended Properties = "Excel 12.0; HDR = Yes; IMEX = 1 "')... [Sheet1 $]
Note:
Excel 2007 workbook File Extension: xlsx
HDR = Yes/No
Optional. specifies whether the column name is in the first row of the Excel table. The default value is Yes. You can modify the default behavior in the registry.
IMEX = 1
(Optional) parses a mix of Intermixed Data Types in an Excel table into text.