Link to home
Start Free TrialLog in
Avatar of ouestque
ouestqueFlag for United States of America

asked on

Oracle/Toad: Connection String

Any of you guys use TOAD to connect to an Oracle database? When starting a new connection you need to enter the following data:

*Host
*Port
*Service Name
*UserId/Password
 *Oracle driver (12g, 8i etc.,)

I am assuming there is a connection string being formed in the back end. Do you know what that is?

I have a sample connection string below that has all these components except the Oracle driver being used. Do you know what the connection string would look like if using 12g_Home?


Example:
Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=???)(PORT=???)))(CONNECT_DATA=(SERVICE_NAME=???)(SERVER=DEDICATED)));User Id=???;Password=???;
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sdstuber, no problem, I didn't take it that way ;-)
But, yes, you're right, regarding the Toad stuff, this won't help much...
Avatar of ouestque

ASKER

My ultimate goal is to create a connection string that does not require Windows ODBC setup or putting an entry in TNSNames.

The connection string I provided above seems to do that. I think... The big problem with it though is that it uses the  10g driver by default instead of 12g. Anyway to adjust the connection string so that it uses 12g? or to somehow set 12g as default in Windows? or to set 12g in VBA or another language when opening it?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sean Stuber
Sean Stuber

Here's an example,  I select the TNS tab (not DIRECT, not LDAP)

I fill in the database field with my tns description

I choose my client (in this case I'm using my 18c client, but you choose whatever you want from your installed clients.)


User generated image


While this does work, it is NOT how I generally use Toad though.
I have approximately 1000 databases I support, I use LDAP and tnsnames to do simple lookups from names, rather than trying to construct a specific connection description every time.
I was just using TOAD to help describe what I'm doing. With the concept of "Hey If TOAD does it, why can't I do it in VBA or C# etc.," I apologize as I described it poorly.

I am trying to connect to an Oracle database via code without setting up ODBC, editing TSNAMES and WITHOUT TOAD.

In my case preferably VBA. My connection string above works flawlessly sometimes. Nonetheless now it stopped working and I think it is because it defaults to using the Oracle driver 10g instead of 12g. I am wondering if there is a way to do one of the following via code not TOAD.

*Adjust the connection string so it always looks at the 12g driver

*Adjust the VBA code so it always looks at the 12g driver

*Adjust Windows settings to always use the 12g driver as default.
please close this question as it appears to have been answered.

and open a new question with your real requirements
Thanks everyone!
So, this is just a duplicate of this question.
Same objective, but it went in a different direction than I was hoping for. (I.e., TOAD) An expert requested I close this so I closed both questions and started a new one with clearer details.