使用QueryTable从SQL输出数据到Excel中时,使用普通的SQL Connection String会出错, 所以查询了大量的网站, 原来SQL文的写法是有一定特殊要求的:
# When using Microsoft Access 12.0 OLE DB Provider to access Access 2007 databases the connection string should look like:
OLEDB;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:/Northwind 2007.accdb;Persist Security Info=False"
# For connecting to SQL Server 2005 databases one of the following drivers can be used:
"OLEDB;Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=DENNIS/SQLEXPRESS"
"OLEDB;Provider=SQLOLEDB;Data Source=DENNIS/SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=Northwind"
使用QueryTable写数据到Excel需要注意的
最新推荐文章于 2023-05-28 09:05:41 发布