Solved

Connecting to Oracle via Microsoft Query fails

Posted on 2013-06-07
4
1,593 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
Comment Utility
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
Comment Utility
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 36

Accepted Solution

by:
Geert Gruwez earned 500 total points
Comment Utility
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
Comment Utility
Couldn't really get it to work problerly. Have dropped it for now.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

744 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

16 Experts available now in Live!

Get 1:1 Help Now