Connection string for SQL server

  • Hi,

    I apologize that this question is not purely for SQL server DBA's but I need help understanding DSN entries provided in ODBC to connect to SQL server. I have checked many application servers dont have this DSN entries in ODBC and some has. So my question is

    1. In which scenario do we need the DSN entries(configured using the driver SQL server Native client) to connect to SQL server from application?

    2. For one of our application while connecting to SQL server we are getting the below message in eventvwr in app server

    Object Server 01: SQL diagnostics: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. Connect information was: Userid = [], Database = [XXX_XXXX_PROD], Server = [XXXXX-NTXXXX], DSN = [], Other = []

    Is it wise to create a system DSN in ODBC and use it in connection string?

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • When you create an ODBC DSN, you provide all the information required for a connection. You can also test that connection as well.

    As it’s a tested DSN (assumed to be) you don’t need to provide anything except DSN Name in connection string.

    I prefer ODBC DSN because it offers flexibility to change the database connection outside the application so no changes are required in application as well as configuration files (if any).

    The drawback with ODBC DSN is it can be cracked easily whereas application connection string is usually encrypted.

  • Sumanta Roy (12/23/2011)


    Hi,

    I apologize that this question is not purely for SQL server DBA's but I need help understanding DSN entries provided in ODBC to connect to SQL server. I have checked many application servers dont have this DSN entries in ODBC and some has. So my question is

    1. In which scenario do we need the DSN entries(configured using the driver SQL server Native client) to connect to SQL server from application?

    2. For one of our application while connecting to SQL server we are getting the below message in eventvwr in app server

    Object Server 01: SQL diagnostics: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. Connect information was: Userid = [], Database = [XXX_XXXX_PROD], Server = [XXXXX-NTXXXX], DSN = [], Other = []

    Is it wise to create a system DSN in ODBC and use it in connection string?

    you may use either the destination servers IP address or the DNS name, it's up to you. DSN name is probably better as if the machines IP changes it doesn't affect your connection to the server

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply