【问题标题】:Is the "Microsoft Office 2007 Primary Interop Assembly" the same thing as the "2007 Office System Driver: Data Connectivity Components"“Microsoft Office 2007 Primary Interop Assembly”是否与“2007 Office System Driver:Data Connectivity Components”相同?
【发布时间】:2013-04-09 18:43:20
【问题描述】:

我正在 Visual Studio 2010 中为需要使用 OleDbConnection 从 xlsx 电子表格读取数据的应用程序创建安装程序(连接字符串类似于 "Provider=Microsoft.Ace.OLEDB.12.0;Data Source='filename';Mode=ReadWrite;Extended Properties='Excel 12.0';HDR='Yes'";

在我的机器上,我一直在安装来自this Microsoft website 的“2007 Office System 驱动程序:数据连接组件”。

在 Visual Studio 中,Installer->Properties->Prerequisites 中的可用先决条件列表不包括“2007 Office System 驱动程序:数据连接组件”,但它确实包括“Microsoft Office 2007 Primary Interop Assemblies”(也可在this Microsoft website 获取)。

我的问题是:将“Microsoft Office 2007 PIA”列为先决条件是否允许我的 OleDbConnection 为尚未安装“2007 Office System 驱动程序:数据连接组件”的人工作?

【问题讨论】:

    标签: visual-studio-2010 visual-studio excel excel-2007 oledb


    【解决方案1】:

    没有。您正在通过 ADO.Net 查询一个 excel 文件,并且需要随附的数据访问驱动程序。为此,您可以embed Microsoft Access Database Engine Redistributable into your setup program as a prerequisite。

    2007 PIA 将允许您通过 COM 互操作创建和自动化 Excel 实例,它更强大(例如,您获得公式单元格更新)但比 Excel 的 OLEDB 界面慢很多。

    【讨论】:

    • 该死!知道是否有一种简单的方法将适当的 ADO.NET 数据访问驱动程序列为先决条件,以便安装程序在目标系统上找不到它时安装它?
    猜你喜欢
    • 2013-03-16
    • 2010-11-22
    • 1970-01-01
    • 2010-09-27
    • 1970-01-01
    • 2011-08-23
    • 1970-01-01
    • 2010-10-16
    • 2010-10-20
    相关资源
    最近更新 更多