来自 MS Access 的 ODBC Oracle 连接错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3881236/
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:40:15  来源:igfitidea点击:

ODBC Oracle Connection error from MS Access

oraclems-accessodbctns

提问by Taryn

I currently support an MS Access database that has linked connections using the Microsoft ODBC Driver for Oracle. I can connect to the current linked tables without any issues, but we are required for security reasons to change the password on the account accessing the Server.

我目前支持使用 Microsoft ODBC Driver for Oracle 链接连接的 MS Access 数据库。我可以毫无问题地连接到当前的链接表,但出于安全原因,我们需要更改访问服务器的帐户的密码。

I have changed the password successfully but now when I attempt to relink the tables I get the error:

我已成功更改密码,但现在当我尝试重新链接表时出现错误:

ODBC--call failed
Microsoft ODBC driver for ORacle ORA-12154: TNS could not resolve service name

These tables are part of a critical application and now we can't connect. Any suggestions on how to resolve this?

这些表是关键应用程序的一部分,现在我们无法连接。有关如何解决此问题的任何建议?

采纳答案by Justin Cave

The ORA-12154 error indicates that you are specifying a TNS alias that is not resolving. Are you using a DSN for your connection to Oracle? If so, what is the TNS alias you're specifying there? Does that alias exist in your tnsnames.ora file? Are there multiple tnsnames.ora files on the client?

ORA-12154 错误表明您指定的 TNS 别名未解析。您是否使用 DSN 连接到 Oracle?如果是这样,您在那里指定的 TNS 别名是什么?您的 tnsnames.ora 文件中是否存在该别名?客户端上是否有多个 tnsnames.ora 文件?

The tnsnames.ora file is on the client machine where Access is installed. Without knowing what version of the Oracle client is installed, the simplest way to find out which tnsnames.ora file is being used is probably to open up a DOS prompt and type "tnsping service_name" where `service_name" is whatever TNS alias is specified in your DSN. You'll get something like

tnsnames.ora 文件位于安装了 Access 的客户端计算机上。在不知道安装了哪个版本的 Oracle 客户端的情况下,找出正在使用的 tnsnames.ora 文件的最简单方法可能是打开 DOS 提示符并键入“tnsping service_name”,其中“service_name”是您在DSN. 你会得到类似

C:\Users\jcave>tnsping fuddy_duddy

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 07-OCT-2
010 08:10:51

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
C:\oracle\product.1.0\db_1\NETWORK\ADMIN\sqlnet.ora

TNS-03505: Failed to resolve name

The "Used parameter files" line tells you the directory where the TNS related files are stored. There should be a tnsnames.ora and a sqlnet.ora file in that directory.

“使用的参数文件”行告诉您存储 TNS 相关文件的目录。该目录中应该有一个 tnsnames.ora 和一个 sqlnet.ora 文件。