如何将我的 DataFactory 实例连接到 Access 数据库?

How to connect my DataFactory instance to an Access Database?

所以我正在设置数据流以将数据从 Access DB 提取到我的 Datafactory,然后推送到 lake/datawarehouses。

我已经在包含该文件的 VM 上设置了集成运行时。我目前正在使用自己的凭据来尝试让连接正常工作。

我开始使用本指南: https://docs.microsoft.com/en-us/azure/data-factory/connector-microsoft-access?tabs=data-factory

进行设置。这是连接字符串:

Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\Users\<myusername>\Documents\test_access.accdb;

身份验证是基本的,使用我的用户名和密码。我已经在 Datafactory 中测试了常规文件系统链接服务的凭据,它们工作正常。

我已经在 VM 上安装了 Access 并打开了数据库。检查并重新安装驱动程序,确保 Integration Runtime 用户和我的用户可以访问 HKEY_LOCAL_MACHINE\SOFTWARE\ODBC 注册表项。集成运行时适用于数据工厂上的其他 files/linked 服务。综上所述,我不断收到此错误:

Error code
9603
Details
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x83c Thread 0x132c DBC 0x6c7884e8 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x83c Thread 0x132c DBC 0x6c7884e8 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x83c Thread 0x132c DBC 0x6c7884e8 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x83c Thread 0x132c DBC 0x6c7884e8 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data. Activity ID: 1ac4d9fc-17ee-4e0d-b5cc-4e0a2d6931da.

我只需要读取权限。我保存了一个副本以供参考,因此它没有被其他用户锁定。我已经登录到 VM 并与该用户打开了相同的数据库,所以它看起来不像是权限错误。我不确定接下来可以尝试什么。

我发现无论我输入什么 user/password 组合,我仍然会得到相同的错误,所以可能是驱动程序问题?

我想通了。

NT Service\DIAHostService 帐户是集成运行时的服务帐户。现在,即使在 Datafactory 中,您也需要指定将打开 Access 数据库的特定用户。事实证明服务帐户 运行 宁 IR 需要完全(读取和 写入 )访问文件以便连接成功。

我想读取文件——而不仅仅是本地——所以我需要 运行 使用我自己的用户的 IR。所以我重新安装了 IR,授予我自己的用户对 IR 配置文件的权限,确保该用户和 Datafactory 上的用户输入具有对 Access 数据库的读写权限,并且 终于一切正常。