Solved

Connecting to Oracle via Microsoft Query fails

Posted on 2013-06-07
4
1,653 Views
Last Modified: 2013-07-30
I am trying to connect to Oracle via Excel 2013 and MS Query Oracle ODBC. I am using the same username, password ans service name that is working just fine from the same pc with PL/SQL Developer, but when I try to connect I get an error message:

ORA-12560: TNS:protocol adapter error - Driver's SQLSetConnectAttr failed

WHat is causing this? In my c:\oracle directory I have a subdirectory orant11 (version 11?).

My sqlnet.ora file in the network\admin-folder looks like this:
# SQLNET.ORA Network Configuration File: c:\oracle\orant11\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

NAMES.DEFAULT_DOMAIN = xxx.no

SQLNET.AUTHENTICATION_SERVICES= (NONE)

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

Open in new window


and the tnsnames.ora file in the same folder looks like this (ip and service names changed for security reasons):

# TNSNAMES.ORA Network Configuration File: c:\oracle\orant11\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
MYAPP.XXX.NO = 
  (DESCRIPTION= 
    (ADDRESS_LIST= 
      (ADDRESS= 
        (PROTOCOL=TCP) 
        (Host=99.9.249.99) 
        (Port=1541) 
      ) 
    ) 
    (CONNECT_DATA= 
      (SERVICE_NAME=MYAPP) 
    ) 
  ) 

Open in new window


Can you please help?

Thx!
0
Comment
Question by:IverErling
  • 3
4 Comments
 

Author Comment

by:IverErling
ID: 39228310
I have found a different way to connect that worked fine right away:

1. Goto Data-pane in Excel.
2. Click on 'From other data sources'
3. Click From wizard for database connection' (just above Microsoft Query)
4. Select 'Other/advanced'
5. Click 'Next'
6. Select 'Oracle provider for OLE DB
7. Input the datasource ip:port/sid
8. Input username and password
9. Click test connection
10. SUCCESS!
0
 

Author Comment

by:IverErling
ID: 39228331
However, the method I outlined above doesn't seem to allow me to use queries, it only transfers entire tables. Which can be useful at times, but I am typically using tables with hundreds of thousands of rows, and hence it is not ideal. So the best would be to get the ODBC connection to work.
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 39228868
oracle client contains different dlls and methods for connecting to a database

restart the oracle client installer
check custom install
and add the odbc/ole db provider options

that should fix the excel problem

sql developer connects with oci component
excel with ole db/odbc component
0
 

Author Closing Comment

by:IverErling
ID: 39366510
Couldn't really get it to work problerly. Have dropped it for now.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now