?
Solved

Connecting to Oracle via Microsoft Query fails

Posted on 2013-06-07
4
Medium Priority
?
1,840 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 38

Accepted Solution

by:
Geert Gruwez earned 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

800 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