Excel ODBC 和 64 位服务器

发布于 2024-07-09 19:01:13 字数 465 浏览 9 评论 0原文

使用 ASP.NET 我需要更新 Excel 模板。

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

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

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

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

如果启用 32 位应用程序设置为 false,Excel 代码将失败并显示错误:

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

有什么建议吗?

using ASP.NET I need to update an excel template.

Our server is running Windows 2008 in 64 bit mode.

I am using the following code to access the excel file:

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

IF the application pool is set to Enable 32 bit applications the code works as expected; however the oracle driver I am using fails as it is only 64 bit.

If Enable 32-bit applications is set to false the excel code fails with the error:

Data source name not found and no
default driver specified

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

孤独岁月 2024-07-16 19:01:13

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

The Microsoft Office team has just released a 64-bit driver

万劫不复 2024-07-16 19:01:13

微软于2008年4月4日发布64位OLEDB FOR ODBC
http://www.microsoft.com/downloads/details.aspx microsoft.com/downloads/details.aspx?FamilyID=000364db-5e8b-44a8-b9be-ca44d18b059b&DisplayLang=en

现在您应该能够运行 64 位的所有内容,您可以尝试一下并让我们知道结果吗?我认为微软应该发布一个64位的Jet Oledb 4.0,如果开发团队没有时间做那就把它放在codeplex.com上让其他程序员来做。

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.

人│生佛魔见 2024-07-16 19:01:13

还有2010 Office System Driver Beta:数据连接组件
链接 这使我们能够从 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;\""

There is also 2010 Office System Driver Beta: Data Connectivity Components
Link which has allowed us to open Excel 2007 (XLS) from a 64bit environment.

This download will install a set of components that can be used by non-Microsoft Office applications to read data from Microsoft Office 2010 Beta files

Our connection string

@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + filePath + ";Extended Properties=\"Excel 12.0;HDR=YES;\""
铁憨憨 2024-07-16 19:01:13

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

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

There are no office drivers for 64bit released.

The (currently) last post at this link:
MSDN Forum details a cumbersome and ugly workaround. You could also replace the Windows Service with a COM exposed assembly, if you wish. Still ugly though. :)

挽梦忆笙歌 2024-07-16 19:01:13

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

Install the 32-bit Oracle driver and enable 32 bit applications?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文