SSIS 为什么所有连接管理器驱动程序都指向 32 位版本?

SSIS why all connection manager drivers pointing to 32 bit versions?

我在 64 位模式下 运行 将我的包导出到 Excel 时苦苦挣扎了很长时间。目前,我已将 Runtime64bit 设置为 false 以完成工作,但出于某些重要原因,我真的想 运行 在 64 位模式下。

为此,我安装了 AccessDatabaseEngine_X64.exe(在卸载现有驱动程序之后)。但是我仍然无法获取连接错误。即使安装了 64 位驱动程序,我也必须在 32 位模式下 运行。怎么了?

我注意到,当我创建新的 Excel 连接时,连接管理器对话框显示驱动程序路径指向 32 位版本。当我查看其他驱动程序时,它们也指向 32 位版本。 (见下面的截图)。这有什么关系吗?

我的环境: - Windows Server 2012 标准版(64 位) - MSSS DT 2012 - MS Excel 2010(64 位) - MicrosfotAccess 数据引擎 2010(64 位)

我的 Excel 文件保存为 97-2003 格式 (.xls)

检查您是否安装了 DtsDebugHost.exe 的两个版本。

如果这样做,您可能需要为 Windows Server 2012 安装最新的服务包。

reference

But I still get unable to acquire connection error. I have to run in 32 bit mode even after installing 64-bit driver. What is wrong?

当您执行您的程序包并查看 Progress 选项卡时,您无疑会收到类似于以下内容的错误消息:

[Connection manager "Excel Connection Manager"] Error: The requested OLE DB provider Microsoft.Jet.OLEDB.4.0 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".

当您设置 Excel 连接管理器时,选择 Excel 97-2003 文件类型将默认为仅提供 32 位版本的 Microsoft Jet OLEDB 驱动程序。

假设您仍然安装了 64 位 Microsoft Access Database Engine 2010 Redistributable,您需要做的是单击您在连接管理器选项卡中创建的 Excel 连接管理器。在“属性”窗格中,查找 ConnectionString 属性(如果按类别分组,则在“杂项”下)。

您会看到 Provider 设置为 Provider=Microsoft.Jet.OLEDB.4.0,仅 32 位驱动程序。如果您选择“Excel 2007”作为文件类型,它将使用 Microsoft.ACE.OLEDB.12.0 32 位或 64 位,具体取决于您安装的 Microsoft Access Database Engine Redistributable。

将 ConnectionString 属性 中的 Provider 更改为 Microsoft.ACE.OLEDB.12.0。当您更改它时,您会注意到错误列表窗格中出现类似于:

的错误

Error 1 Validation error. Data Flow Task 1: Package: The requested OLE DB provider Microsoft.ACE.OLEDB.12.0 is not registered. If the 32-bit driver is not installed, run the package in 64-bit mode. Error code: 0x00000000. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered". Package.dtsx 0 0

Error 2 Validation error. Data Flow Task 1: Package: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=219816 Package.dtsx 0 0

这些错误与 SSDT 和您之前提出的观点有关:

When I looked at other drivers, they are also pointing to 32-bit version. (see screenshot below). Is there anything to do with this?

SQL Server Data Tools 是一个 32 位应用程序,这可能是您在“添加 SSIS 连接管理器”对话框中看到连接管理器指向 32 位版本的原因。很久以前就提出了 64 位 SSDT 的请求。如果您尝试执行您的程序包,这也是这些新错误出现在执行前和弹出消息框中的原因。

注意错误是 验证 错误,提示了解决方案。

Select 您的 Excel 连接管理器,将 DelayValidation 属性 设置为 False。这将停止显示预执行错误。其次,对于使用您的 Excel 连接管理器的包或控制流任务,将 DelayValidation 属性 设置为 False。这允许您 运行 包并在 运行 时间停止错误。

让我引用这个FAQ - How to run SSIS Packages using 32-bit drivers on 64-bit machine

On 64 Operating System when you install Integration Services it will install 32-Bit and 64-Bit version of DTExec commandline tool which is used to execute SSIS packages.

DTExec 32-Bit can be found under : C:\Program Files (x86)\Microsoft SQL Server\DTS\Binn

DTExec 64-Bit can be found under : C:\Program Files\Microsoft SQL Server\DTS\Binn For more information click on the following URL

http://msdn.microsoft.com/en-us/library/ms162810.aspx

If your SSIS package is referencing any 32-Bit DLL or 32-Bit drivers from your package then you must use 32-Bit version of DTExec to execute SSIS package.

-- 编辑 --

通过示例进行扩展解释。

假设您创建了一个新的 SSIS 包。在其中连接到一个 Excel 文件。为此,您需要有 MS Office,或者 Microsoft Access 2016 运行time 在执行包的机器上。

所以,您正在桌面上的 VS 中创建包。您安装了 Office 32 位并且一切正常。

部署到服务器时,在本例中为 Windows 2012(64 位)。你认为... 停止!服务器位无关紧要。好的,但是我的 SQL 服务器是 64 位的,所以...不,这也没关系!

发布 SSIS 包后,查看计划的作业属性。在那里你可以在 64 或 32 位模式下指定 运行。

根据这个你需要安装正确版本的驱动!

运行 64 位 SSIS 包;安装 64 位驱动程序!

运行 在 32 位上;然后安装 32 位驱动程序!