How do I connect to an Oracle database from Excel to run some queries when I don't have access to tns or ODBC?
I currently have a series of SQL queries that I run on the (Oracle) database of a commercial system in multiple companies to do some analysis checks.
At the moment I connect using a java application (SquirrelSQL) and JDBC with the oracle thin connection.
e.g.With java, all I need from the client is the host, port, s-id, username and password.Code:jdbc:oracle:thin:@<hostname>:<port>:<oracle-sid> jdbc:oracle:thin:@localhost:1521:XE
I have the Oracle driver file (ojdbc6.jar) with me and SquirrelSQL as a portable application running from my USB stick.
I run each query then copy the output and paste it into Excel to present it nicely to the client.
It would be nicer if I had all the SQL stored in some VBA, then just updated the connection details on the first sheet and pressed a button to populate the sheets automatically.
However, I can't seem to work out how to connect to oracle using VBA.
When I try stuff like this:
http://www.vbforums.com/showpost.php...31&postcount=2
I get the error:
"data source name not found and no default driver specified"
Is there a dll that I need to load that I can take around with my sheet (like the ojdbc.jar)?




Reply With Quote