Solved

Connecting to Oracle via Microsoft Query fails

Posted on 2013-06-07
4
1,760 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

738 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