sql-server-2008 - 无法开始分布式事务 : Linked Server -> Access database

标签 sql-server-2008 ms-access odbc msdtc linked-server

眼镜:

  • SQL Server 2008
  • 服务器 2008 R2 64 位
  • MS Access 数据库

  • 什么工作:
  • 我通过安装办公室 Access 数据组件并创建系统 DSN 等,配置了到 Access 数据库的链接服务器连接。
    它驻留在同一服务器上的目录中。
  • 我已经成功通过openquery查询数据。

    SELECT * FROM OPENQUERY(LINKEDHELL, 'SELECT * FROM [D:\path\mordor.mdb].Orcs')
  • 我可以通过 openquery 插入/更新/删除(从 Sql Management Studio 内部)

  • 什么不起作用:

    我创建了一个数据库,它公开了一个包含 openquery 表达式的 View 。这使我的应用程序可以忽略它通过链接服务器连接进行查询的事实,并允许我使用 ORM。举个例子: Entity Framework 。

    然而,虽然检索数据有效,但更新/插入/删除不会。
    我花了很多时间来确保 MSDTC 配置正确,但没有骰子。

    我试过的

    MSDTC
  • 启用网络 DTC Access
  • 允许入站/出站
  • 配置防火墙
  • 启用 XA 事务
  • 授予 DTC 工作 Access 权限的帐户 .mdb
  • 进行这些设置后重新启动 Sql Server

  • 其他
  • 配置链接服务器安全性:在 sql 用户和本地管理员帐户之间创建映射,以便当我使用该 sql 用户登录时,它使用本地管理员帐户连接到 Access 数据库。
  • 为 RPC 启用分布式事务的提升:False

  • 我得到的错误:
    OLE DB provider "MSDASQL" for linked server "LINKEDHELL" returned message "[Microsoft][ODBC Microsoft Access Driver]Invalid attribute/option identifier ".
    Msg 7391, Level 16, State 2, Line 4
    The operation could not be performed because OLE DB provider "MSDASQL" for linked server "LINKEDHELL" was unable to begin a distributed transaction.
    

    我可以通过从 Sql Management Studio 执行此操作来简单地重新创建它
    begin distributed transaction
    
    //anything that queries the linked server
    
    commit transaction
    

    那么我错过了什么?
    我读过 ODBC 驱动程序支持分布式事务,但我不确定 ACCESS 数据库是否支持。因此,如果有人至少可以确认这一点。那会有所帮助。

    最佳答案

    Access doesn't have transactions, because Access is not a database engine. Jet/ACE (Access's default db engine) has supported commit/rollback as long as I've used it (since Jet 2.x, e.g., 1996). It has never supported transaction logging and probably never will (I recognize that's not what you're asking about but many of those coming to Jet/ACE from server database backgrounds are rather foggy on the meaning of the term "transactions" and have a hard time grasping that Jet/ACE supports one and not the other). – David-W-Fenton Jan 16 '10 at 23:12



    -- Do we have transactions in MS-Access?

    David W Fenton, MVP, RIP

    关于sql-server-2008 - 无法开始分布式事务 : Linked Server -> Access database,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11575530/

    相关文章:

    sql - 锁升级 - 这里发生了什么?

    mysql - Qt 的 odbc 驱动程序不支持 mysql 的 LastInsertId,解决方法是什么?

    java - 如何使用 JNI 将 C ODBC 连接公开到 JVM?

    java - 创建表并写入 Servlet

    sql-server - 从另一列中删除不在最小日期和最大日期之间的行

    sql - 想要从评论部分提取变量信息

    SQL 条件连接一次性连接到多个表

    c# - 从一个 MS Access 数据库插入到另一个 MS Access 数据库

    java - 将日期插入 Access DB 时出现问题 - 由于时间变化,小时不存在

    C# 使用 schema.ini 导入 CSV 文件创建表但不加载数据