Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I cannot connect oracle 12c database for 64 bit to excel 2013 macro....!!
It says Data source name not found and no default driver specified....is there something I am missing?? Kindly help....

Regards
Posted
Comments
CHill60 17-Mar-14 8:26am    
How are you attempting this connection? What is the connectionstring you've used?
planetz 17-Mar-14 8:49am    
This is my code...

<pre lang="vb">
Dim conn As New ADODB.Connection
conn.Open "DRIVER={MICROSOFT ODBC FOR ORACLE};uid=xyz;pwd=x123".</pre>

And these are references used:
Visual Basic for Applications
MS Excel 15.0 Objct Lib
MS Office 15.0 Objct Lib
Ole Automation
MS Active Data Objects 2.0 Lib
Jörgen Andersson 17-Mar-14 17:15pm    
Have you installed and configured the Oracle Client software?
planetz 18-Mar-14 7:23am    
no I didn't...I have the database in my machine only...so...I used oracle 10g in office 2010...but then I didn't need to install any client..it worked fine with the above code...can you please tell me why will I need it and how to get the software? thank you...
Jörgen Andersson 18-Mar-14 7:55am    
The machine that's having the database, already have the client installed. It's all other Machines that need a client

1 solution

Ok....I got a way....making a DSN connection does it all....here are the steps:

My Computer ---> Control Panel ---> Administrative tools ---> Right click on ODBC data source(64 bit) ---> add ---> choose oracle driver ---> finish--> then window will open asking some username password and DSN name ---> create DSN use previously mentioned code like this:

VB
Dim conn As New ADODB.Connection
conn.Open "DSN=dsnName;uid=xyz;pwd=x123"


Thats it!! :) :)

If you want to make a DSN less connection then use this:

VB
Dim conn As New ADODB.Connection
conn.Open "driver={driver name in your machine};uid=xyz;pwd=x123"
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900