[RESOLVED] dsn-less connection string
I need to create a db connection to an oracle db using vba[6.3], but I need to have it dsn-less [-what I currently have is a pain b/c I have to set up the odbc connection on other machines].
I got the following from connectionstrings.com. How do I make it dsn-less?
Code:
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;
This is what I currently use:
Code:
'Create DB connection
Dim myDb As New ADODB.Connection
'Create a new recordset
Dim rsTemp As New ADODB.Recordset
'Open the DB using the clmSystem argument as a string
myDb.Open "DSN=claimsDB;SERVER=QACLMS01.DB;PWD=" & clmSystem & "_user;UID=" & clmSystem & "_user;"
Thanks for your help.
Re: dsn-less connection string
To make it DSN-less, simply replace the string after myDb.Open with the other string you found (obviously replacing the UserID etc with the relevant details).
I don't use Oracle myself, but from previous threads about it, you still need to set up the Oracle client on each of the machines - the only part this will save you is creating the DSN itself.
Re: dsn-less connection string
Quote:
Originally Posted by nadia
I need to create a db connection to an oracle db using vba[6.3], but I need to have it dsn-less [-what I currently have is a pain b/c I have to set up the odbc connection on other machines].
Why don't you just create the ODBC DSN connection programatically? The link shows how to create a ODBC DSN connection for SQL Server but I am sure that you can adjust it to create on for Oracle.