11

使用 ASP.NET 我需要更新一个 excel 模板。

我们的服务器在 64 位模式下运行 Windows 2008。

我正在使用以下代码访问 excel 文件:

    ...
    string connection = 
@"Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ=" + path + ";";
    ...

如果应用程序池设置为启用 32 位应用程序,则代码按预期工作;但是我使用的 oracle 驱动程序失败了,因为它只有 64 位。

如果启用 32 位应用程序设置为 false,则 excel 代码将失败并出现以下错误:

未找到数据源名称且未指定默认驱动程序

有什么建议么?

4

5 回答 5

7

Microsoft Office 团队刚刚发布64 位驱动程序

于 2010-05-11T18:11:46.410 回答
2

Microsoft release a 64bit OLEDB FOR ODBC in 2008/04/04 http://www.microsoft.com/downloads/details.aspx?FamilyID=000364db-5e8b-44a8-b9be-ca44d18b059b&DisplayLang=en

Now you should able to run everything 64bit, can u try it and let us know the result and personally I think Microsoft should release a 64bit Jet Oledb 4.0, if the development team has no time to do it then just put it in codeplex.com and let other programmers do it.

于 2009-06-02T17:26:19.397 回答
2

还有2010 Office System Driver Beta: Data Connectivity Components Link,它允许我们从 64 位环境打开 Excel 2007 (XLS)。

此下载将安装一组组件,非 Microsoft Office 应用程序可以使用这些组件从 Microsoft Office 2010 Beta 文件中读取数据

我们的连接字符串

@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + filePath + ";Extended Properties=\"Excel 12.0;HDR=YES;\""
于 2010-03-25T22:38:56.987 回答
0

没有发布 64 位的办公驱动程序。

此链接上的(当前)最后一篇文章: MSDN 论坛详细介绍了一种麻烦且丑陋的解决方法。如果您愿意,您还可以将 Windows 服务替换为 COM 公开的程序集。不过还是很丑。:)

于 2009-03-18T21:22:56.033 回答
-1

安装 32 位 Oracle 驱动程序并启用 32 位应用程序?

于 2009-06-11T10:18:43.237 回答