使用ODBC连接到Oracle DB [英] Connect to an Oracle DB using ODBC

查看:231
本文介绍了使用ODBC连接到Oracle DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,该应用程序需要与内容明确的"旧版Oracle数据库进行交互.要开始该过程,我想开始使用到MS Access数据库的ODBC链接在该数据库中创建视图,以便我可以确定数据库的结构,但不能确定如何设置与Oracle DB的ODBC连接.

I am developing an application that needs to interract with a "lightly documented" Legacy Oracle Database. To Start that process I want to start creating a view into that Database using ODBC links into an MS Access database so I can figure out the DB structure but I can't figure out how to setup the ODBC connection to the Oracle DB.

我已经能够使用主机名和服务名连接到SQL Developer并查看数据库;但是,我不知道如何设置ODBC.我正在运行Windows 7,并且已经安装了Oracle 11g,Oracle Express Edition,Instant Client和ODBC扩展.但是在ODBC设置上,Oracle希望我选择一个TNS服务名称,但是没有一个可供选择,也没有指定主机的位置.我试图在tnsnames.ora中设置一个TNS;但我不确定我知道该文件的正确位置.

I have been able to connect using the Host and Service Name to and view the DB using SQL Developer; but, I can't figure out how to setup ODBC. I am running Windows 7 and have installed Oracle 11g, Oracle Express Edition, the Instant Client and ODBC extensitons; but on the ODBC setup Oracle wants me to pick a TNS Service Name but there is none to pick and there is no place to specify the host. I tried to setup a TNS in tnsnames.ora; but I am not really sure I know the right location for that file.

我真的认为这将是容易的部分;但是,实际上还没有.

I really thought this would be the easy part; but, it really hasn't been.

推荐答案

导航到控制面板> 管理工具> 数据源(ODBC)

选择系统DSN 标签,然后点击添加".接下来,向下滚动驱动程序列表,直到找到 Oracle的Microsoft ODBC .

Select the System DSN tab and click 'Add'. Next scroll down the lists of drivers until you find Microsoft ODBC for Oracle.

在上面的表格中填写所需的信息,然后单击确定".现在,您可以通过单击外部数据"选项卡,然后单击更多",将表添加到访问"中.选择"ODBC数据库",然后选择导入源数据...",然后单击机器数据源"选项卡.

Fill in the required information in the above form and click 'OK'. Now you can add the tables to 'Access' by clicking on the 'External Data' tab then clicking on 'More'. Choose 'ODBC Databases', then 'Import the source data...', next click on the 'Machine Data Source' tab.

这篇关于使用ODBC连接到Oracle DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆