数据库链接 - Oracle 10g 和 Ms Access 2007

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3573744/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 21:22:50  来源:igfitidea点击:

Database Links - Oracle 10g and Ms Access 2007

databaseoraclems-accessdatabase-link

提问by deedeky

I'm trying to create a link between oracle 10g and ms access 2007 but I don't know how to set parameters in my tnsnames.ora file to access my MS Access db. I've created new Data Source in ODBC Data Source Administrator with Microsoft Access Driver and selected my access db (.mdb).

我正在尝试在 oracle 10g 和 ms access 2007 之间创建链接,但我不知道如何在我的 tnsnames.ora 文件中设置参数以访问我的 MS Access 数据库。我使用 Microsoft Access 驱动程序在 ODBC 数据源管理器中创建了新的数据源,并选择了我的访问数据库 (.mdb)。

In the MS Access I can link between tables and I see data from my Oracle db, but I need to create a database link from Toad or SqlDeveloper so I can change data in MS Access db with some trigger in my Oracle db. When I try to test my db link I get the following error : Error : ORA-12154: TNS:could not resolve the connect identifier specified, because I don't know what parameters I need to write into my tnsnames.ora file. MS Access db is located on my hard drive. Here is how my tnsnames.ora looks like :

在 MS Access 中,我可以在表之间进行链接,我可以看到来自我的 Oracle 数据库的数据,但我需要从 Toad 或 SqlDeveloper 创建一个数据库链接,以便我可以使用我的 Oracle 数据库中的某些触发器更改 MS Access 数据库中的数据。当我尝试测试我的数据库链接时,我收到以下错误:错误:ORA-12154:TNS:无法解析指定的连接标识符,因为我不知道需要将哪些参数写入我的 tnsnames.ora 文件。MS Access db 位于我的硬盘上。这是我的 tnsnames.ora 的样子:

accdb =
  (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = localhost) (PORT = 3306)
  )
  (CONNECT_DATA =
      (SID = hsodbc)
  (HS=OK)
 )

but I'm not sure for PORT and SID.

但我不确定 PORT 和 SID。

Any help?

有什么帮助吗?

回答by Martin Mares

This article shows how Oracle's Heterogeneous Services can be configured to allow a database to connect to a Microsoft Access database using standard databases links:

本文展示了如何配置 Oracle 的异构服务以允许数据库使用标准数据库链接连接到 Microsoft Access 数据库:

http://www.orafaq.com/node/60

http://www.orafaq.com/node/60