select查询中的$符号
为什么我们在select查询中给$符号?
(“select * from [Sheet1 $]”,连接);
我试图没有$符号的回收数据,但它显示错误。
所以有人澄清我在$ Sheet1 $需要什么
ODBC和Ole DB的SQL语法稍有不同
•For ODBC: SELECT "Column Name" FROM "Sheet One$". Ie excel worksheet name followed by a "$" and wrapped in double quotes.
•For Ole DB: SELECT [Column Name] FROM [Sheet One$]. Ie excel worksheet name followed by a "$" and wrapped in "[" "]" brackets.
Odbc连接string:
对于Excel 2.0-2003
DRIVER={Microsoft Excel Driver (*.xls)};IMEX=1;MaxScanRows=16;DBQ=C:\Invoice.xls;
对于Excel 2007
DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};IMEX=1;MaxScanRows=16;DBQ=C:\Invoice.xls;
高级ETL处理器和Visual Import ETL都使用odbc连接到Excel
OLE DB连接string:
对于Excel 2.0-2003
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";
对于Excel 2007
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=1";
资源