OleDbConnection连接Excel时,Excel加了密码,请教连接字符串怎么写

如题所述

第1个回答  2015-02-06
Microsoft.Jet.OLEDB.4.0不支持带密码的excel文件

http://support.microsoft.com/kb/257819
原文中写了

On the Connection tab, browse to your workbook file. Ignore the "User ID" and "Password" entries, because these do not apply to an Excel connection. (You cannot open a password-protected Excel file as a data source. There is more information on this topic later in this article.)

打开带密码的。你可以使用Workbooks.Open
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbooks.open.aspx
第2个回答  2015-02-06
OleDb
连接加密excel代码提供
相似回答