提取数据,然后插入到Excel

问题描述:

我试图从MySQL得到我的数据导入Excel IM使用提取数据,然后插入到Excel

insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\testing.xls;', 'SELECT * FROM [main]') select * from adel;
插在我的Excel中的数据,但我不断收到此错误

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "The Microsoft Jet database engine could not find the object 'main'. Make sure the object exists and that you spell its name and the path name correctly.". 
Msg 7350, Level 16, State 2, Line 1 
Cannot get the column information from OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)". 


任何人都可以给我一些指针

您可以使用SELECT...INTO OUTFILE语句将数据存储到CSV文件可以在MS Excel中打开。

此外,您还可以在命令行模式下使用dbForge Studio for MySQL使用直接data export to *.xls file

为什么不把mysql导出到csv,可以用Excel打开。更多信息:http://www.electrictoolbox.com/create-csv-file-mysql-php/