I get confused about establishing an ODBC or OLE DB connection to a foreign data source.
First I must have the necessary drivers installed, right ? These originate from the host package...in this case the Oracle client, right ?
Once I do that, I need to create a USER or SYSTEM DSN......or can I just patch the connection string and credentials into the Connection property of the connecton within Excel ?
I've always been confused on the best way to handle this. In a multiple developer environment, it would seem stupid for me for everyone to create their own DSN and then have to change all of them when any data source changes are made.
DSN / Connection string for Oracle database access
-
- 4StarLounger
- Posts: 584
- Joined: 12 Jul 2012, 10:34
-
- Administrator
- Posts: 78391
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DSN / Connection string for Oracle database access
I prefer to work with DSN-less connections. Assembling the connection string in VBA isn't that hard.
The Connection Strings Reference has examples of connection strings for all kinds of data sources.
The Connection Strings Reference has examples of connection strings for all kinds of data sources.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 584
- Joined: 12 Jul 2012, 10:34
Re: DSN / Connection string for Oracle database access
Hans - Thanks for that reminder about the DSN vs. DSN-less technique.....now it's coming back to me.
However, in the case of Oracle specifically, isn't there a "native" ODBC driver they provide as part of their client installation vs. the one that Microsoft supplies as part of the Office installation ? I believe one should use the Oracle-supplied driver....no ?
However, in the case of Oracle specifically, isn't there a "native" ODBC driver they provide as part of their client installation vs. the one that Microsoft supplies as part of the Office installation ? I believe one should use the Oracle-supplied driver....no ?
-
- Administrator
- Posts: 78391
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DSN / Connection string for Oracle database access
Microsoft will phase out its ODBC driver for Oracle, it recommends using the driver provided by Oracle.
From ODBC Driver for Oracle:
From ODBC Driver for Oracle:
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 584
- Joined: 12 Jul 2012, 10:34
Re: DSN / Connection string for Oracle database access
Thanks Hans....but how to distinguish between the two ?
Also, to get the connection string specific to the Oracle ODBC driver, isn't it best just to set-up the DSN one-time and then use the connection attributes that are exposed when the connection is completed ?
Also, to get the connection string specific to the Oracle ODBC driver, isn't it best just to set-up the DSN one-time and then use the connection attributes that are exposed when the connection is completed ?
-
- Administrator
- Posts: 78391
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DSN / Connection string for Oracle database access
Yes, that's a valid way of obtaining a connection string!
Best wishes,
Hans
Hans