Microsoft Access Database Engine 2010 Redistributable 64 位仅在启用 32 位设置为 true 时才有效 [英] Microsoft Access Database Engine 2010 Redistributable 64 bit only works if Enable 32-bit set to true

查看:71
本文介绍了Microsoft Access Database Engine 2010 Redistributable 64 位仅在启用 32 位设置为 true 时才有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 ASP 经典应用程序,我要从 Windows 2000 迁移到 Windows 2012 Server.

I have an ASP classic application that I'm migrating from a Windows 2000 to Windows 2012 Server.

它使用以下代码导入xls文件

It uses the following code to import xls files

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DRIVER={Microsoft Excel Driver (*.xls)}; IMEX=1; HDR=NO; Excel 8.0; DBQ=" & Server.MapPath("Imports") &""&fn& "; "

以及以下用于 csv 文件的内容

and the following for csv files

Set objConn = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPathtoCSVFile & ";Extended Properties=""text;HDR=YES;FMT=Delimited"""

根据这个问题的答案Excel ODBC 和 64 位服务器我下载并安装了 Microsoft Access Database Engine 2010 Redistributable.

As per the answer on this question Excel ODBC and 64 bit server I downloaded and installed the Microsoft Access Database Engine 2010 Redistributable.

我已经尝试了上述的 32 位和 64 位版本,但除非我将应用程序池设置启用 32 位应用程序更改为 True,否则它们都不起作用.如果将其设置为 False,则会出现以下错误.

I've tried both the 32bit and the 64bit version of the above but neither of them work unless I change the application pool setting Enable 32-bit applications to True. If it is set to False I get the below error.

Microsoft OLE DB Provider for ODBC Drivers 错误80004005"

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

不幸的是,在该网站的另一部分将其设置为 True 会中断 PDF 渲染.

Unfortunately setting it the True breaks PDF rendering in another part of that website.

到目前为止,我想出的唯一可行的选择是将这部分设置在它自己的 32 位应用程序池下.

The only viable option I have come up with so far is to set this part up under it's own application pool that is 32-bit.

如何在 64 位应用程序池中运行它?

How can I run this in 64-bit Application Pool?

在有人带着骗子之前,一个不能解决问题的相关问题是使用 Access 数据库在 64 位环境中运行的 ASP

And before someone comes along with a dupe hammer, a related question that does not resolve the issue is ASP running in 64 bits environment with Access database

推荐答案

首先,请确保安装 64 位软件包 AccessDatabaseEngine_x64.exe 成功.

First, make sure you install the 64-bit package AccessDatabaseEngine_x64.exe successfully.

之后,使用以下连接字符串.
您应该不会再遇到使用 64 位应用程序池的问题.

After that, use the following connection strings.
You should no longer have problems working with your 64-bit application pool.

'Excel 97-2003
Set Connection = Server.CreateObject("ADODB.Connection")
    Connection.Open _
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:mypath	o	ables.xls;Extended Properties=""Excel 8.0;HDR=NO;IMEX=1"";"
Set Recordset = Connection.Execute("Select * From [Sheet1$]")

'CSV / TXT
Connection.Open _
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:mypath	ocsv_dir;Extended Properties=""text;HDR=YES;FMT=Delimited"";"
Set Recordset = Connection.Execute("Select * From table.csv")

connectionstrings.com 一直是连接字符串的良好参考.

connectionstrings.com has always been a good reference for connection strings.

这篇关于Microsoft Access Database Engine 2010 Redistributable 64 位仅在启用 32 位设置为 true 时才有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆