DSN vs Connection string

  • Hi gurus

    I Like to know that, Deference between DSN and Connection string, What are the Advantages & Disadvantages. I googled on the but not got any sutisfactrial explanation.

    🙁

    Ali
    MCTS SQL Server2k8

  • It really depends on the applications at the client and how they are used. In some cases a DSN can be superior to a connection string. OTOH, DSNs are in the registry and can be an additional security risk.

    Generally speaking I would opt for connections strings, but there are some cases where a DSN would be more useful. That's all I can say without knowing more about how you are using them.

    The probability of survival is inversely proportional to the angle of arrival.

  • Thank you very much sturner for your time,

    Actually I want to know what are the Defrences in both?

    Ali
    MCTS SQL Server2k8

  • DSN

    A DSN (Data Source Name) is an identifier which defines a data source for an ODBC driver.

    A DSN consists of information such as:

    • Database name

    • Directory

    • Database driver

    • User ID

    • Password

    Connection String

    A connection string is a string that specifies information about a data source and the means of connecting to it. It is passed in code to an underlying driver or provider in order to initiate the connection

    DSN use in a connection string

    Example

    Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

    myServerAddress is a DSN and whole string is called Connection String

    Regards,
    Syed Jahanzaib Bin Hassan
    BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA

    My Blog
    www.aureus-salah.com

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

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