Results 1 to 3 of 3

Thread: [RESOLVED] dsn-less connection string

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    65

    Resolved [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.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  3. #3
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    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.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width